PHP : Accessing Mysql Database

PHP : Accessing Mysql Database

<html>
<body>
<?php
$con = mysql_connect("localhost","admin","pwd");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}


else
{
mysql_select_db("vinDB", $con);


$result = mysql_query("SELECT * FROM temp");


while($row = mysql_fetch_array($result))
{
dy>
<?php
$con = mysql_connect("localhost","admin","nimda");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}


else
{
mysql_select_db("vinDB", $con);
$result = mysql_query("SELECT * FROM temp");


while($row = mysql_fetch_array($result))
{
echo $row['eid'] . " " . $row['name'];
echo "<br />";
}


}


echo $row['eid'] . " " . $row['name'];
echo "<br />";
}


}


mysql_close($con);
?>
</body>
</html>

Comments

Most Viewed Post

solution for facebook static.ak.fbcdn.net waiting

Connect Sony XPLOD MEX-BT2500 Bluetooth CD Receiver with ur mobile

Crystal Report : Show data horizontally (Left to right) i.e. columns as rows

Google+ Followers