tome Posted June 26, 2007 Share Posted June 26, 2007 Hi there, i've got a flash based video site, i'm working on integrating a guestbook so users can leave comments about the videos. this is my communication scheme: flash->php->sql->php->flash my write function works great and the user can leave a comment based on unique titleID (video number) but i'm having a hard time fetching entries related to the current playing video, in my flash output window i can see that my videoID variable (video number) is passed from flash to php using loadVars so i assume that i've got a problem with my php script. This is the code I'm using in php to fetch data from sql: $id=mysql_escape_string($_GET['videoID']); $sql = "SELECT * FROM $table WHERE titleID = $id"; any ideas? Quote Link to comment Share on other sites More sharing options...
Caesar Posted June 26, 2007 Share Posted June 26, 2007 <?php $sql = "SELECT * FROM $table WHERE titleID = '$id'"; ?> Quote Link to comment Share on other sites More sharing options...
tome Posted June 26, 2007 Author Share Posted June 26, 2007 ok it's working now thank you, however i fetch zero entries even though i've got comments for the video playing stored in the database. i added this php print code: print '<PRE style="text-align:left;">'; print_r($sql); die("<P>Script Halted...</P>"); print '</PRE>'; and when i test it online i get this sql quary: SELECT * FROM guestbook WHERE titleID = '000000000?videoID=000000000' ORDER BY `time` DESC LIMIT 0, 10Script Halted... while the sql quary that will yield results should be: SELECT * FROM guestbook WHERE titleID = '000000000' ORDER BY `time` DESC LIMIT 0, 10 somehow i pass my variable twice??? this is my flash request: myEntries = new LoadVars(); myEntries.ref = this myEntries.videoID = videoID myEntries.sendAndLoad("GuestBook.php?action=read&r="+random(999)+"&NumLow="+_parent.NumLow+"&videoID="+videoID,myEntries,"GET"); and again my php code: $id=mysql_escape_string($_GET['videoID']); $sql = "SELECT * FROM $table WHERE titleID = '$id'"; any ideas? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 26, 2007 Share Posted June 26, 2007 give us the url of the page giving you $id messed up that might be a clue Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 26, 2007 Share Posted June 26, 2007 odds are your url has multiple get variables taht aren't porperly being delimtetred in the url a get var must be in the method http://mypage.com/page.html?getvar1=value1&getvar2=value2&getvar3=value3 each one is seperated by & not a question mark Quote Link to comment Share on other sites More sharing options...
tome Posted June 26, 2007 Author Share Posted June 26, 2007 u can see it here: http://jewishtvnetwork.com/guestbook1/ Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 26, 2007 Share Posted June 26, 2007 i'm confused how are you having a $_GET variable declared if the URL does not display them? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 26, 2007 Share Posted June 26, 2007 and your source code isn't helpful since its all in flash check your flash links because odds are is what i said earlier and so ?videoid=THISID and the ?newvariable until it finds another & or end of url is reached Quote Link to comment Share on other sites More sharing options...
tome Posted June 26, 2007 Author Share Posted June 26, 2007 well i'm testing but it seems fine to me yet i still get the ? after my titleID number at the flash output window. this is my flash code: myEntries = new LoadVars(); myEntries.sendAndLoad("GuestBook.php?action=read&r="+random(999)+"&NumLow="+_parent.NumLow+"&videoID="+videoID,myEntries,"GET"); and this is how it looks in the output window: "/GuestBook.php?action=read&r=634&NumLow=0&videoID=00000000?" how do i get rid of the ? after the id number...??? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted June 26, 2007 Share Posted June 26, 2007 that seems to be a flash question Quote Link to comment Share on other sites More sharing options...
emehrkay Posted June 27, 2007 Share Posted June 27, 2007 my suggestion is to use post with your sendAndLoad. it clearly states in the flash documentation that you are limited to 256 characters with get Quote Link to comment Share on other sites More sharing options...
tome Posted June 27, 2007 Author Share Posted June 27, 2007 thx man "POST" did the trick Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.