本文整理汇总了PHP中DBQuery::values_exist方法的典型用法代码示例。如果您正苦于以下问题:PHP DBQuery::values_exist方法的具体用法?PHP DBQuery::values_exist怎么用?PHP DBQuery::values_exist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBQuery
的用法示例。
在下文中一共展示了DBQuery::values_exist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: debug
$message = $requesta['data']['sms_text'];
if ($id == '') {
$sql = "INSERT INTO debug (content, date) values ('BAD ID: " . mysql_real_escape_string($short) . "', '{$date}');";
mysql_query($sql);
print "no id\n";
die;
}
$sql = "SELECT location_name FROM location JOIN incident ON incident.location_id = location.id WHERE incident.id = {$id};";
$current_loc_name = DBQuery::return_value_from_sql($sql);
if ($current_loc_name != $unknown_loc && $current_loc_name != '') {
// SOMEONE HAS SET THIS LOCATION WHILE BEING PROCESSED AT CF: ignore CF.
print "\n<p>Location {$current_loc_name} already exists in Ushahidi instance<p>\n";
die;
}
$sql = "SELECT randomIdentifier FROM incident_automated WHERE idIncident = '{$id}' AND randomIdentifier = '" . $randIdent . "'; ";
$matchRand = DBQuery::values_exist($sql);
if (!$matchRand) {
print "nomatching rand\n{$sql}\n";
$sql = "INSERT INTO debug (content, date) values ('BAD RAND: incident_id = {$id} for " . mysql_real_escape_string($short) . "', '{$date}');";
mysql_query($sql);
//die; #security - ignore requests where the random identifier isnt the one we gave for this task
// repress this for now and continue: some ids changed post-migration
}
$sql = "UPDATE incident_automated SET returned_json = '" . mysql_real_escape_string($_POST['payload']) . "', status = '2' WHERE idIncident = '{$id}'";
$res = mysql_query($sql);
$latitude = $requesta['results']['zload']['centroid'][0];
$longitude = $requesta['results']['zload']['centroid'][1];
if ($latitude == 0 || $latitude == '') {
$latitude = $requesta['results']['latitude_longitude_zoom']['centroid'][0];
$longitude = $requesta['results']['latitude_longitude_zoom']['centroid'][1];
}