quickstopman Posted November 15, 2007 Share Posted November 15, 2007 im currently using a tutorial to build a blog in flash i need to use a PHP page i keep getting this error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pokebash/public_html/getmetola/blog/blog.html on line 7 here is the code: <?php mysql_pconnect ("localhost", "pokebash_pwnage", "moses1"); mysql_select_db ("blogdb"); $qResult = mysql_query("SELECT * FROM blog_entries ORDER BY id DESC"); $nRows = mysql_num_rows($qResult); $rString ="&n=". $nRows; for ($i=0; $i< $nRows; $i++){ $row = mysql_fetch_array($qResult); $rString .="&id".$i."=".$row['id']."&"."&title".$i."=".$row['title']."&"."&date".$i."=".$row['date']."&"."&entry".$i."=".$row['entry']."&"; } echo $rString."&"; ?> any ideas? Link to comment https://forums.phpfreaks.com/topic/77541-i-cant-figure-out-what-is-wrong-with-this-code/ Share on other sites More sharing options...
teng84 Posted November 15, 2007 Share Posted November 15, 2007 <?php mysql_pconnect ("localhost", "pokebash_pwnage", "moses1"); mysql_select_db ("blogdb"); $qResult = mysql_query("SELECT * FROM blog_entries ORDER BY `id` DESC") or die (mysql_error()); $nRows = mysql_num_rows($qResult); $rString ="&n=". $nRows; for ($i=0; $i< $nRows; $i++){ $row = mysql_fetch_array($qResult); $rString .="&id".$i."=".$row['id']."&"."&title".$i."=".$row['title']."&"."&date".$i."=".$row['date']."&"."&entry".$i."=".$row['entry']."&"; } echo $rString."&"; ?> try and tell us the result Link to comment https://forums.phpfreaks.com/topic/77541-i-cant-figure-out-what-is-wrong-with-this-code/#findComment-392501 Share on other sites More sharing options...
quickstopman Posted November 16, 2007 Author Share Posted November 16, 2007 ok it now works!! thanks Link to comment https://forums.phpfreaks.com/topic/77541-i-cant-figure-out-what-is-wrong-with-this-code/#findComment-392503 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.