当前位置: 首页>>代码示例>>PHP>>正文


PHP XDB::error方法代码示例

本文整理汇总了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";
    }
}
开发者ID:Ekleog,项目名称:platal,代码行数:7,代码来源:clean.php

示例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";
    }
}
开发者ID:Ekleog,项目名称:platal,代码行数:11,代码来源:checkdb.php

示例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");
    }
开发者ID:Ekleog,项目名称:platal,代码行数:31,代码来源:emails.check.php


注:本文中的XDB::error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。