本文整理匯總了PHP中query::error方法的典型用法代碼示例。如果您正苦於以下問題:PHP query::error方法的具體用法?PHP query::error怎麽用?PHP query::error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類query
的用法示例。
在下文中一共展示了query::error方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: query
function reset_sequence($sequence, $newval)
{
$this->nextid($sequence);
$esequence = $sequence . "_seq";
$SQL = "setval('{$esequence}', {$newval})";
$query = new query($this, $SQL);
return $query->error();
}
示例2: values
function reset_sequence($sequence, $newval)
{
$this->nextid($sequence);
$esequence = $sequence . "_seq";
$sSQL = "Replace into {$esequence} values ('', {$newval})";
$query = new query($this, $sSQL);
return $query->error();
}
示例3: flush
echo ".";
flush();
}
$SQL = "select id, attachment from {$rec['table_name']}";
$q->query($DB, $SQL);
if ($q->numrows() > 0) {
echo "Converting Attachments for {$rec['name']}<br />\n";
while ($rec2 = $q->getrow()) {
$id = $DB->nextid("{$rec['table_name']}_attachments");
if ($id == 0 && $DB->type != "mysql") {
echo "Could not get an id for the attachment.<br />\n";
} else {
if ($rec2[attachment]) {
$SQL = "Insert into {$rec['table_name']}_attachments (id, message_id, filename) values({$id}, {$rec2['id']}, '{$rec2['attachment']}')";
$q2->query($DB, $SQL);
$err = $q2->error();
if ($err == "") {
if ($DB->type == "mysql") {
$id = $DB->lastid();
}
$new_name = "{$AttachmentDir}/{$rec['table_name']}/{$rec2['id']}" . "_{$id}" . strtolower(strrchr($rec2["attachment"], "."));
if (!rename("{$AttachmentDir}/{$rec['table_name']}/{$rec2['attachment']}", $new_name)) {
echo "Can't save upload file.";
}
}
} else {
echo "Error adding attachment. DB said: {$err}<br />\n";
}
}
}
$SQL = "ALTER TABLE {$rec['table_name']} DROP attachment";