本文整理匯總了PHP中mysql::db方法的典型用法代碼示例。如果您正苦於以下問題:PHP mysql::db方法的具體用法?PHP mysql::db怎麽用?PHP mysql::db使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mysql
的用法示例。
在下文中一共展示了mysql::db方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: connect
public static function connect($host, $name, $wachtwoord, $db, $makedb = false)
{
if (empty($host) || empty($name) || empty($wachtwoord) || empty($db)) {
//return false;
}
self::$database = $db;
//Used @ phpbb plugin
self::$db = @mysql_connect($host, $name, $wachtwoord);
if (self::$db === false) {
return self::$db;
} else {
if ($makedb === true) {
$sql = "CREATE DATABASE " . $db;
if (!@mysql_query($sql, self::$db)) {
st_die(SQL, "ERROR CREATING DB", "", __LINE__, __FILE__, $sql);
self::sql_close();
return false;
}
}
self::$db2 = @mysql_select_db($db, self::$db);
if (self::$db2 === false) {
self::sql_close();
return self::$db2;
} else {
return self::$db;
}
}
}
示例2: elseif
</center>
<?php
} elseif ($_GET['do'] == 'check_item') {
$matrix = unserialize($_GET['matrix']);
$i = $_GET['i'];
$j = $_GET['j'];
$a = $_GET['a'];
echo $size;
$game1 = new HQ_Sudoku($size);
$game1->grid = $matrix;
$valid = $game1->valid_item($i, $j, $a);
if ($valid) {
$game1->set_item($i, $j, $a);
//save to db
$db = new mysql('sql311.summerhost.info', 'sum_6305668', '1671988');
$db->db('sum_6305668_test');
$db->query("update sudoku set grid='" . $game1->matrix_string() . "'");
echo '<textarea>' . $game1->matrix_string() . ($game1->is_full_matrix() ? '[DONE]' : '') . '</textarea>';
echo '<script>test.get_line(1).content("' . valid_str_in_str($game1->suggest_result(false, 'ok')) . '");</script>';
exit;
} else {
//out1($i.'-'.$j);
$game1->remove_item($i, $j);
echo '<textarea>' . $game1->matrix_string() . '[FALSE]</textarea>';
exit;
}
} elseif ($_GET['do'] == 'suggest_item') {
$i = $_GET['i'];
$j = $_GET['j'];
$matrix_origin = unserialize($_GET['matrix_origin']);
$matrix = unserialize($_GET['matrix']);