I want to set a variable to mysql field value, I know this code works upto print $info['username'] command but it's not working to set $username, as the echo $username is not displaying any information.
Can anyone show where I have gone wrong.
Thanks
<?php
mysql_connect("", "", "") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
$data = mysql_query("SELECT * FROM pds")
or die(mysql_error());
Print "<table>";
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<th></th> <td>".$info['username']."</td> ";
}
Print "</table>";
$username = $info['username'];
echo $username;
?>