faraz
1
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 .
faraz
2
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
nabeel
3
You can use the API too:
PilotData::updateProfile($pilotid, array('current' => 'value'));
1 Like