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; 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 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. 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. Link to comment https://forums.phpfreaks.com/topic/202942-syncrhonouse-processing-or-not/#findComment-1067215 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.