blue-genie Posted May 26, 2010 Share Posted May 26, 2010 assume my flash file passes a value to my php to get some data using an ID. but if the ID doesn't exist I want to go get the ID from the database. would this kind of logic work $curGameID = $_REQUEST['gameID']; if ($curGameID == "") { $gameResult = mysql_query("SELECT gameID from gamedetails where startDate <= date('".$compDateStr."') AND endDate >= date('".$compDateStr."') AND gameIsActive = 1"); $gameID = mysql_query($gameResult); $curGameID = $gameID; } and then here have another select statement using a WHERE gID = $gameID; Quote Link to comment https://forums.phpfreaks.com/topic/202942-syncrhonouse-processing-or-not/ Share on other sites More sharing options...
priti Posted May 26, 2010 Share Posted May 26, 2010 $gameID = mysql_query($gameResult); $curGameID = $gameID; $gameID is of type resource you need to read you records from the resource by using mysql_fetch_row() or mysql_fetch_assoc(). http://php.net/manual/en/function.mysql-query.php Quote Link to comment https://forums.phpfreaks.com/topic/202942-syncrhonouse-processing-or-not/#findComment-1063494 Share on other sites More sharing options...
blue-genie Posted May 26, 2010 Author Share Posted May 26, 2010 but will the logic work? the process as such. Quote Link to comment https://forums.phpfreaks.com/topic/202942-syncrhonouse-processing-or-not/#findComment-1063501 Share on other sites More sharing options...
priti Posted June 3, 2010 Share Posted June 3, 2010 logically yes, $curGameID = $_REQUEST['gameID']; //u are reading curgameid if (trim($curGameID) == "") { //you are checking if empty gameid //logic to fetch the id from database } Hope it helps. Quote Link to comment https://forums.phpfreaks.com/topic/202942-syncrhonouse-processing-or-not/#findComment-1067215 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.