Jump to content

i can't figure out what is wrong with this code :(


quickstopman

Recommended Posts

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?

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.