hisham
IS-IT--Management
- Nov 6, 2000
- 194
I used the following code to display the name, and photo records from employee table
$query = mysql_query("SELECT * FROM emp"
while ($row = mysql_fetch_row($query)) {
echo "<table>";
echo "<tr><td><img src=\"$row[3]\" border=\"0\"></td></tr>" . "<tr><td><a href=\"detailes.php?hid=$row[0]\">$row[1]</a></td></tr></table>";
}
?>
this display the data in the same place, Now who can I display i.e. first record of the data in a cell at the top of the page, and the forth record in some other cell in the page. When I used: if ($row = mysql_fetch_row($query)) this return the first record only and when I use: while ($row = mysql_fetch_row($query)) this retrive all the data in the same place of the page.
Thanks in advance.
$query = mysql_query("SELECT * FROM emp"
while ($row = mysql_fetch_row($query)) {
echo "<table>";
echo "<tr><td><img src=\"$row[3]\" border=\"0\"></td></tr>" . "<tr><td><a href=\"detailes.php?hid=$row[0]\">$row[1]</a></td></tr></table>";
}
?>
this display the data in the same place, Now who can I display i.e. first record of the data in a cell at the top of the page, and the forth record in some other cell in the page. When I used: if ($row = mysql_fetch_row($query)) this return the first record only and when I use: while ($row = mysql_fetch_row($query)) this retrive all the data in the same place of the page.
Thanks in advance.