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? Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
quickstopman Posted November 16, 2007 Author Share Posted November 16, 2007 ok it now works!! thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.