本文整理汇总了PHP中SQLite3::lastInsertRowid方法的典型用法代码示例。如果您正苦于以下问题:PHP SQLite3::lastInsertRowid方法的具体用法?PHP SQLite3::lastInsertRowid怎么用?PHP SQLite3::lastInsertRowid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLite3
的用法示例。
在下文中一共展示了SQLite3::lastInsertRowid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: time
}
}
$time = time();
if ($time % 3600 < $t) {
$time -= 3600;
}
$time = (int) ($time / 3600) * 3600 + $t;
$db->query("INSERT INTO log (time,addr{$vars}) VALUES ({$time},{$addr}{$val})\n");
$rrd_file = $RRD_HOME . "/openhr20_" . $addr . ".rrd";
if (file_exists($rrd_file)) {
$cmnd = "rrdtool update " . $rrd_file . " " . $time . ":" . (int) $st['real'] . ":" . (int) $st['wanted'] . ":" . (int) $st['valve'] . ":" . (int) $st['window'];
echo $cmnd . "\n";
system($cmnd);
}
}
}
}
}
}
}
}
}
if ($debug) {
//debug log
echo $line . "\n";
$db->query("INSERT INTO debug_log (time,addr,data) VALUES (" . time() . ",{$addr},\"{$line}\")");
$deleteThld = $db->lastInsertRowid() - $maxDebugLines;
$db->query("DELETE FROM debug_log WHERE id<{$deleteThld}");
}
// echo " duration ".(microtime(true)-$ts)."\n";
}
示例2: insert
public function insert($table, $data)
{
if (is_object($data)) {
$data = (array) $data;
}
if (!is_string($table) || !is_array($data) || !$this->hasTable($table)) {
throw new Exception("SQLITE: Invalid parameter.");
}
$data = $this->filterColumns($table, $data);
$fields = array_keys($data);
$condition = $this->buildInsertCondition($data)['condition'];
$sql = "INSERT INTO '{$table}' ('" . implode("','", $fields) . "') VALUES (" . implode(",", $condition) . ")";
$preparing = $this->queryPreparation(parent::prepare($sql), $this->buildInsertCondition($data)['values']);
$preparing->execute();
return parent::lastInsertRowid();
}