I have a query that returns me all 24 records in a database.
Now how can I format different areas of a page to show different rows.
I.E. if I use echo $row_query... it shows me the first record.
How can I for example show the 5th record?
Ron
After a query how do I display a certain row only?
Moderator: General Moderators
Code: Select all
<?php
$dbc = mysql_connect('user','name','pass');
mysql_select_db('mydb',$dbc);
$res = mysql_query ('SELECT col1,col2,col3 FROM mytable',$dbc);
$mydata = array();
while ( $row = mysql_fetch_assoc($res) ) $mydata[] = $row;
echo 'Here is col2 from row 3:' . $mydata[2]['col2'] .'<br>'."\n";
?>