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