faraz Posted March 28, 2010 Report 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
faraz Posted March 28, 2010 Author Report 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
Administrators Nabeel Posted March 28, 2010 Administrators Report Posted March 28, 2010 You can use the API too: PilotData::updateProfile($pilotid, array('current' => 'value')); 1 Quote
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.