change this line:

$qResult = mysql_query ("SELECT * FROM commentbook ORDER BY id DESC"); 

to this:

$qResult = mysql_query ("SELECT * FROM commentbook ORDER BY id DESC") or die(mysql_error()); 

This will see if your query is in fact working correctly. If it is, we can move on to other things.

    stolzyboy wrote:

    change this line:

    $qResult = mysql_query ("SELECT * FROM commentbook ORDER BY id DESC"); 

    to this:

    $qResult = mysql_query ("SELECT * FROM commentbook ORDER BY id DESC") or die(mysql_error()); 

    This will see if your query is in fact working correctly. If it is, we can move on to other things.

    Thanks for such a fast reply! Once I made the changes you suggested I noticed the problem (I had entered the wrong name for the table). So I fixed that and tested it again, only to get a new error...

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&Total number_of_entries=3&id0=4&visitor0=Tylor Skory&email0=Tylor_Famous@yahoo.c' at line 1

    This is strange because is starts to list what is in the database but cuts it off or something? Any ideas why?

      What exactly are you trying to do? You're definitely not producing syntax that MySQL is ever going to recognize...

        bradgrafelman wrote:

        What exactly are you trying to do? You're definitely not producing syntax that MySQL is ever going to recognize...

        I am following along with a lesson and I am trying to produce something that FLASH will be able to recognize.

          That's what I thought; that definitely looks like a string that a browser or Flash application might understand, but why are you trying to execute that string as a MySQL query inside your for() loop??

            Ack, Flash/PHP integration, fun stuff there.

            I don't think you'd want to run a query on the string you are trying to send to FLASH.

            Brad, maybe you know, but to get variables to/from flash, you send query_string type string to flash and grab the variables that way. It's really cumbersome at times.

              stolzyboy wrote:

              Brad, maybe you know, but to get variables to/from flash, you send query_string type string to flash and grab the variables that way. It's really cumbersome at times.

              I think we're both replying at the same time. :p

                So far it seems like I ALMOST have it. At this point I was supposed to have a long string of text (something along the lines of "&Totalnumber_of_entries=3&id0=4&visitor0=Tylor Skory&email0=...")

                It starts to do that but stops half way through (I have no idea why that would be). It just stops writing it or something.

                If I can just get it to spit out that long string of text then I think I will be all good.

                Right now it only spits this out.

                You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '&Totalnumber_of_entries=3&id0=4&visitor0=Tylor Skory&email0=Tylor_Famous@yahoo.c' at line 1

                  Again, why are you taking this string of data that you're going to pass to your Flash application and executing it as a MySQL query? MySQL can't understand Flash's method of reading data, and even if it could... there's no point in sending the data you just received back to the DB in a query.

                  Remove the mysql_query() call inside the for() loop, and remove the 2 lines below the echo() statement where you call mysql_query() again.

                    bradgrafelman wrote:

                    Again, why are you taking this string of data that you're going to pass to your Flash application and executing it as a MySQL query? MySQL can't understand Flash's method of reading data, and even if it could... there's no point in sending the data you just received back to the DB in a query.

                    Remove the mysql_query() call inside the for() loop, and remove the 2 lines below the echo() statement where you call mysql_query() again.

                    I honestly don't know. I am simply following along with a lesson and must have messed up somewhere. I didn't write the lesson I am just following it.

                      OK from just fooling around I got it to work! Thanks for your time guys!

                        Write a Reply...