Mpango Wa Project
Mpango Wa Project
<? $username="username"; $password="password"; $database="your_database"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM contacts"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Database Output</center></b><br><br>"; $i=0; while ($i < $num) { $first=mysql_result($result,$i,"first"); $last=mysql_result($result,$i,"last"); $phone=mysql_result($result,$i,"phone"); $mobile=mysql_result($result,$i,"mobile"); $fax=mysql_result($result,$i,"fax"); $email=mysql_result($result,$i,"email"); $web=mysql_result($result,$i,"web"); echo "<b>$first $last</b><br>Phone: $phone<br>Mobile: $mobile<br>Fax: $fax<br>E-mail: $email<br>Web: $web<br><hr><br>"; $i++; } ?>
img path: <input type=text name=img /> <input type=submit /> </form> </body> </html> <?php $con = mysql_connect(localhost,root,"); if (!$con) { die(Could not connect: . mysql_error()); } mysql_select_db(TEST , $con); $sql=INSERT INTO tbl_images(ID, IMAGE) VALUES ($_POST[id], LOAD_FILE($_POST[img])); mysql_query($sql,$con); echo 1 record added; mysql_close($con); ?> Step 4: To retrieve image from database create retrieve.php file Syntax: <?php $img=; $link = mysql_connect(localhost, root, ); mysql_select_db(TEST );
$sql = SELECT image FROM tbl_images WHERE id=2; $result = mysql_query($sql); header(Content-type: image/jpg); mysql_result($result, 0); mysql_close($link); echo <div><img src=.$img./></div>; ?> No related posts.
Share this
Leave a Comment
Name (required)
Website
Our Services
Web Designing
Connect With Us
Our Associates
Quick Contact
Name* E-Mail*
http://www.scribd.com/searchdocuments?limit=10&page=23&query=local+area+network+project+report