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?

Link to comment
Share on other sites

<?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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.