本文整理汇总了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";