Building with Flash (blog) and MySQL

Okay, so I came across this tutorial, and so far so good.

Bascially through MySQL, and a little php help … I will be able to create a live working Flash Blog. Everything seems to be going smoothly, until I go to test it in the web browser, and I recieve this error.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/content/B/o/n/BoneJour/html/test.php on line 7
&n=&

Here is the code I’m using on my .php file to access the mysql table.


<?php
mysql_pconnect ("host", "username", "password");

mysql_select_db ("blog_db");
$qResult = mysql_query ("SELECT * FROM blog_entries ORDER BY id DESC");

$nRows = mysql_num_rows($qResult); // LINE 7 issue <<<<<<<<<
$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."&";

?>

Note that in this posting, my hostname, username, and password have been set to default. I’m not posting that information. :slight_smile:

I appreciate any help. Again, I am still learning ALL of this “on the go”, and strictly following tutorials. SO any help is very appreciative, so speak in “small” words to me in terms of php coding, etc … :smiley: thx all

**Edit:**Secondly, I created the tables once in blog_db; with …


[FONT=Verdana, Arial, Helvetica][SIZE=2]CREATE TABLE blog_entries (
id INT NOT NULL AUTO_INCREMENT ,
date DATETIME NOT NULL ,
title VARCHAR (30 )NOT NULL ,
entry LONGTEXT NOT NULL ,
PRIMARY KEY (id)
[/SIZE][/FONT][FONT=Verdana, Arial, Helvetica][SIZE=2] );[/SIZE][/FONT]
[FONT=Verdana, Arial, Helvetica][SIZE=2] 
[/SIZE][/FONT]

[FONT=Verdana, Arial, Helvetica][SIZE=2]

Here’s what it looks like.

[/SIZE][/FONT]