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? Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/ 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'"; ?> Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283310 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? Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283474 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 Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283476 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 Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283479 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/ Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283481 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? Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283484 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 Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283486 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...??? Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283529 Share on other sites More sharing options...
cooldude832 Posted June 26, 2007 Share Posted June 26, 2007 that seems to be a flash question Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283530 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 Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-283582 Share on other sites More sharing options...
tome Posted June 27, 2007 Author Share Posted June 27, 2007 thx man "POST" did the trick Link to comment https://forums.phpfreaks.com/topic/57306-solved-flash-php-sql-php-flash/#findComment-284321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.