示例#1
0
 }
 if (strstr($table_prefix, '.') and $nextAccess == 1) {
     $msg .= "<SPAN class=err>{$strPrefixErr}</span><br />";
     $nextAccess = 0;
 }
 if ($nextAccess == 1) {
     include '../include/db.php';
     // 连结数据库
     $DM = new DummyMySQLClass($dbhost, $dbuser, $dbpassword, $dbname, false);
     if ($DM->error()) {
         $msg .= "<SPAN class=err>{$strNoConnDB}</span><br />";
         $nextAccess = 0;
     }
 }
 if ($nextAccess == 1) {
     $mysqlversion = $DM->fetchArray($DM->query("SELECT VERSION() AS version"));
     $curr_mysql_version = $mysqlversion['version'];
     if ($curr_mysql_version < '4.0') {
         $msg .= "<SPAN class=err>{$strMixMysql}</span><br />";
         $nextAccess = 0;
     }
 }
 if ($nextAccess == 1) {
     if ($curr_mysql_version > '4.1') {
         $DM->query("ALTER DATABASE `{$dbname}` DEFAULT CHARACTER SET {$dbcharset} ");
     }
     if ($DM->error()) {
         $msg .= "<SPAN class=err>{$strDBInfo}</span><br />";
         $nextAccess = 0;
     }
 }
示例#2
0
    echo $DMC->error();
    die;
}
// select
$sql_Select = "select * from dmc_demo where name = 'Dummy' ";
$SelectResult = $DMC->query($sql_Select);
if (false === $SelectResult) {
    echo '查询失败。<BR>';
    echo $DMC->errno() . " : ";
    echo $DMC->error();
    die;
}
// 下面分别显示处理结果的四种方法。
echo '<PRE>';
// 1
while ($fa = $DMC->fetchArray()) {
    print_r($fa);
}
// 2
$DMC->dataSeek(0);
// 重置内部结果的指针
while ($fa = $DMC->fetchAssoc()) {
    print_r($fa);
}
// 3
$DMC->dataSeek(0);
// 重置内部结果的指针
while ($fa = $DMC->fetchRow()) {
    print_r($fa);
}
// 4