> select query in php ~ Online tutorial

select query in php

select query in php
From the select query in php.we are going to select entire or extract data from the table .we are using mysql_query()to retrieve the data.here example for go to get data from database.


?php
$conn=mysql_connect("localhost","root","");
$sel=mysql_select_db("proj",$conn);
$c = mysql_query("select * from data");

echo "<table border='1'>";
echo "<tr><td>name</td><td>Last name</td><td>Address</td><td>Email id</td><td>Phone</td></tr>";
while($row = mysql_fetch_array($c))
{
echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td>$row[3]</td><td>$row[4]</td></tr>";
}
echo "</table>";




?>

Output




Buy it 40% discount

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: