本文整理匯總了PHP中XDB::error方法的典型用法代碼示例。如果您正苦於以下問題:PHP XDB::error方法的具體用法?PHP XDB::error怎麽用?PHP XDB::error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XDB
的用法示例。
在下文中一共展示了XDB::error方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: query
function query($sql)
{
XDB::execute($sql);
if (XDB::errno() != 0) {
echo "error in \"{$sql}\":\n", XDB::error(), "\n";
}
}
示例2: checkCount
function checkCount($sql, $comment = '')
{
$count = XDB::rawFetchOneCell($sql);
if ($err = XDB::error()) {
echo $err;
}
if ($count > 0) {
echo "Erreur pour la vérification : {$comment}\n{$sql}\n\n";
echo "|\tTotal\t|\n|\t{$count}\t|\n\n";
}
}
示例3: ON
* Check duplicated addresses
*/
$it = Xdb::iterRow("SELECT s1.email, s2.email, r1.redirect\n FROM email_redirect_account AS r1\n INNER JOIN email_redirect_account AS r2 ON (r1.redirect = r2.redirect AND r1.uid != r2.uid)\n INNER JOIN email_source_account AS s1 ON (s1.uid = r1.uid AND s1.type = 'forlife')\n INNER JOIN email_source_account AS s2 ON (s2.uid = r2.uid AND s2.type = 'forlife')\n LEFT JOIN email_watch AS w ON (r1.redirect = w.email)\n WHERE w.email IS NULL\n GROUP BY r1.redirect\n ORDER BY r1.redirect, s1.email");
$insert = array();
$conflits = array();
while (list($alias1, $alias2, $mail) = $it->next()) {
$insert[] = "('{$mail}', 'pending', CURDATE(), NOW())";
$conflits[] = "* {$mail} sur {$alias1} et {$alias2}";
}
if (count($conflits) > 0) {
echo "Nouvelles adresses en doublon détectées :\n" . join("\n", $conflits) . "\n\nVous pouvez entrer les informations collectées à ce sujet sur la page :\n" . "https://www.polytechnique.org/admin/emails/duplicated";
echo "\n\n";
$sql = "INSERT IGNORE INTO email_watch (email, state, detection, last)\n VALUES " . join(", ", $insert);
XDB::execute($sql);
if (XDB::errno() != 0) {
echo 'Error : ' . XDB::error() . "\n{$sql}";
}
}
/*
* Check dead emails
*/
if ($panne_level > 0) {
$res = XDB::fetchAllAssoc("SELECT r.redirect, a.hruid\n FROM email_redirect_account AS r\n INNER JOIN accounts AS a ON (a.uid = r.uid)\n WHERE r.broken_level = {?} AND r.flags != 'broken'\n ORDER BY a.hruid", $panne_level);
if ($res) {
echo "Nouvelles adresses en panne detectees :\n";
foreach ($res as $assoc) {
echo '* ' . $assoc['redirect'] . ' pour ' . $assoc['hruid'] . "\n";
}
echo "\n\n";
Xdb::execute("UPDATE email_redirect_account\n SET flags = 'broken'\n WHERE broken_level = 3");
}