faraz Posted March 28, 2010 Report Share Posted March 28, 2010 Hello How can i send data into a database table ? I created field in phpvms_pilots table and name it current , i want send last location in phpvms_pilots table . <?php $allpilots = PilotData::getAllPilots(); foreach($allpilots as $pilot) { ?> <?php include 'db2.php'; $last_location = PIREPData::getLastReports($pilot->pilotid, 1, PIREP_ACCEPTED); mysql_query("UPDATE phpvms_pilots SET current=('$last_location->arricao') WHERE ID='$pilot->pilotid'") ?> <?php } ?> but no data insert in current field . Quote Link to comment Share on other sites More sharing options...
faraz Posted March 28, 2010 Author Report Share Posted March 28, 2010 Solved <?php $allpilots = PilotData::getAllPilots(); foreach($allpilots as $pilot) { ?> <?php include 'db2.php'; $last_location = PIREPData::getLastReports($pilot->pilotid, 1, PIREP_ACCEPTED); mysql_query("UPDATE phpvms_pilots SET current = ('$last_location->arricao') WHERE pilotid ='$pilot->pilotid'"); ?> <?php } ?> I want automatically update current field every 10 minutes Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted March 28, 2010 Administrators Report Share Posted March 28, 2010 You can use the API too: PilotData::updateProfile($pilotid, array('current' => 'value')); 1 Quote Link to comment Share on other sites More sharing options...
faraz Posted March 28, 2010 Author Report Share Posted March 28, 2010 Thanks Nabeel 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.