Hi there I've got a guestbook setup in flash with a php form that communicates with SQL database. everything works fine. Since my site is video based I'm trying to enhance this guestbook so each video will have only related entries displayed in the guestbook.

each video has a titleID and when the user submits a comment for specifiec video the titleID number is stored in the titleID column in the guestbook database.

my problem is how to fetch only entries related to the current playing video.
for fetching the entries back to flash I've got this php code:

$sql = "SELECT * FROM $table WHERE titleID = $videoID ";

working when i set up this varaible:

$videoID = "titleID";

however i still get all the comments from my database instead of the ones related to the current playing video.

if I change the varaible name with a titleID number like this:

$sql = "SELECT * FROM $table WHERE titleID = 123456789";

i'm able to get only titles associated with this titleID number, however this way i will have to create a php form for each video....i've got tons

I'm no php/sql expert, just a beginner however my logic tells me that I'm doing something wrong in defining the titleID varaible for the flash/php connection,
any ideas? I've been stuck on this for days...

    you can see what you're sending MySQL by doing a

    print $sql;

    My guess is that $videoID is empty, and your query is being send like this:

    SELECT * FROM your_table WHERE titleID =

    Or maybe even $table is empty. What does the code above print?

      ok the code above prints this:
      SELECT * FROM guestbook WHERE titleID = titleID ORDER BY time DESC LIMIT 0, 10

      in order to pass the unique titleID from flash to SQL when the user sends a comment i trace the titleID to a textbox in the write MC so when the user presses the submit_bt my table recieve the unique titleID for each video

      i understand that in order for the read form to retrieve only related entries i need to define my titleID so that my read MC will pass the titleID varaible from flash via loadvars i'm just not sure how to do it...???

        Write a Reply...