Go with: $query = "SELECT * from counter"; $result = mysql_query($query) or die("Error:".mysql_error()); $i = 0; while( $row=mysql_fetch_array(result) { echo "$i = ".$row['time']."<BR>"; $i++; }
this assumes that you've opened your server connection and selected database prior to executing the snippet -----Original Message----- From: Chris Hogben [mailto:[EMAIL PROTECTED]] Sent: Monday, December 31, 2001 3:56 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] newbie: MySQL Problem or severe ignorance.. I've just been looking at this snippet, and wondering why it's not working.. Either i'm doing something wrong, or i'm just totally ignorant.. (More likely the latter). But if anyone can help me out, please let me know.. --- $query = "SELECT * from counter"; $result = mysql_query($query); $numone = mysql_numrows($result); $i = 0; while ($i <= $numone) { $seekrow = mysql_data_seek($result, $i); $fetchrow = mysql_fetch_row($result); $time = $fetchrow["time"]; echo "$i = $time<br>"; $i++; } --- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]