Pull from mysql_fetch_array at a given time
| From: | Tom Beidler | Date: | Tue, 04 Dec 2001 01:00:59 +0000 |
| Subject: | Pull from mysql_fetch_array at a given time | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-76444@lists.php.net to get a copy of this message | ||
I'm trying to pull three results from a database and then display them in a
page. The HTML is clugey so I would like to place print statements in three
different places, rather then in a while loop and try and rewrite the HTML
for each item.
So far I have;
$gethot_query = "SELECT title FROM events WHERE status = 'hot' ORDER BY
date";
$gethot_result = mysql_query ($gethot_query)
or die ("Cannot get hot
items!");
$gethot_row = mysql_fetch_array ($gethot_result);
?>
<tr>
<td colspan="7" valign="top" bgcolor="#FFE49A"
class="hotheadlines">
<p><br>
<? print ("$gethot_row[1]"); ?></p>
I know I'm not calling the print statement correctly but hopefully you get
the idea. I would like to add
<? print ("$gethot_row[1]"); ?> for the first item.
<? print ("$gethot_row[2]"); ?> for the second
<? print ("$gethot_row[1]"); ?> for the third.
Am I approaching this from the wrong way?
Thanks,
Tom