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

Popular Posts