本文整理汇总了PHP中mysql_drop_db函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_drop_db函数的具体用法?PHP mysql_drop_db怎么用?PHP mysql_drop_db使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_drop_db函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DropDatabase
function DropDatabase(&$db, $name)
{
if (!$db->Connect()) {
return 0;
}
if (function_exists("mysql_drop_db")) {
$success = mysql_drop_db($name, $db->connection);
} else {
$db->EscapeText($name);
$success = mysql_query("DROP DATABASE {$name}", $db->connection);
}
if (!$success) {
return $db->SetError("Drop database", mysql_error($db->connection));
}
return 1;
}
示例2: mysql_field_name
$name = mysql_field_name($result, $i);
}
$f = "";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$f .= join("\r\n", $row);
}
if (empty($f)) {
echo "<b>File \"" . $sql_getfile . "\" does not exists or empty!</b><br>";
} else {
echo "<b>File \"" . $sql_getfile . "\":</b><br>" . nl2br(htmlspecialchars($f)) . "<br>";
}
mysql_free_result($result);
mysql_query("DROP TABLE tmp_file;");
}
}
mysql_drop_db($tmpdb);
//comment it if you want to leave database
}
}
}
}
echo "</td></tr></table>";
if ($sql_sock) {
$affected = @mysql_affected_rows($sql_sock);
if (!is_numeric($affected) or $affected < 0) {
$affected = 0;
}
echo "<tr><td><center><b>Affected rows: " . $affected . "</center></td></tr>";
}
echo "</table>";
}
示例3: mysql_drop_db
<?php
try {
mysql_drop_db('');
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
示例4: die
print "<head><META HTTP-EQUIV='Refresh' CONTENT='1;url={$self}?s={$s}&login={$login}&passwd={$passwd}&server={$server}&port={$port}'></head>";
} else {
die("{$h_error}" . mysql_error() . "{$f_error} <head><META HTTP-EQUIV='Refresh' CONTENT='2;url={$self}?s={$s}&login={$login}&passwd={$passwd}&server={$server}&port={$port}'></head>");
}
unset($new_db);
}
/*Удаление базы*/
if (isset($_GET['drop'])) {
$result_d = mysql_list_dbs($connection) or die("<td bgcolor=#DAD9D9>{$h_error}" . mysql_error() . "{$f_error}</td></tr></table>");
while ($row_d = mysql_fetch_row($result_d)) {
if ($drop == $row_d[0]) {
$dr = "TRUE";
}
}
if ($dr == "TRUE") {
mysql_drop_db($drop, $connection);
print "<center><font size=2>База <b>{$drop}</b> успешно удалена...</font></center><br>";
print "<head><META HTTP-EQUIV='Refresh' CONTENT='1;url={$self}?s={$s}&login={$login}&passwd={$passwd}&server={$server}&port={$port}'></head>";
}
unset($drop);
}
/*-------------Читаем произвольный файл сервера-----------*/
if (isset($f)) {
print $form_file;
}
if (isset($p_file)) {
// mysql_create_db("tmp_bd",$connection) or die("$h_error<b>".mysql_error()."</b>$f_error");
// mysql_create_db("tmp_bd") or die("$h_error<b>".mysql_error()."</b>$f_error");
// mysql_query('CREATE TABLE `tmp_file` ( `Viewing the file in safe_mode+open_basedir` LONGBLOB NOT NULL );') or die("$h_error<b>".mysql_error()."</b>$f_error");
$result = mysql_query("SELECT hex(load_file('" . addslashes($p_file) . "')) as `fc`") or die("{$h_error}<b>" . mysql_error() . "</b>{$f_error}");
// $query = "SELECT * FROM tmp_file";
示例5: dropDB
function dropDB($DBName)
{
/* 丢弃(删除)一个 MySQL 数据库 */
return mysql_drop_db($DBName, $this->LinkId);
}
示例6: install
function install($dbfile, $datafile = "", &$returnArr)
{
$createCount = 0;
$fillCount = 0;
if (mysql_drop_db($this->_dbname)) {
$returnArr[0] = "Dropping database: {$this->_dbname}.<br>...Done";
} else {
$returnArr[0] = "Using new database.<br>...Done";
}
if (mysql_create_db($this->_dbname)) {
$returnArr[1] = "Creating database: {$this->_dbname}.<br>...Done";
} else {
new ErrorHandler(get_class($this), "install", "", "could not create database: {$this->_dbname}");
}
if (!mysql_select_db($this->_dbname)) {
new ErrorHandler(get_class($this), "install", "", "could not select database: {$this->_dbname}");
} else {
$returnArr[2] = "Using database: {$this->_dbname}.<br>...Done";
}
if (!file($dbfile)) {
new ErrorHandler(get_class($this), "install", "", "could not open {$dbfile}");
} else {
$createCount = $this->installFile($dbfile);
$returnArr[3] = "Creating tables.<br>...Done<br>{$createCount} queries affected";
}
if ($datafile != "") {
if (!file($datafile)) {
new ErrorHandler(get_class($this), "install", "", "could not open {$datafile}");
} else {
$fillCount = $this->installFile($datafile);
$returnArr[4] = "Filling tables.<br>...Done<br>{$fillCount} queries affected";
}
}
return true;
}
示例7: mysql_field_name
$name = mysql_field_name($result, $i);
}
$f = "";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
foreach ($line as $key => $col_value) {
$f .= $col_value;
}
}
if (empty($f)) {
echo "<b>File \"" . $sql_getfile . "\" does not exists or empty!</b>";
} else {
echo "<b>File \"" . $sql_getfile . "\":</b><br>" . nl2br(htmlspecialchars($f));
}
}
mysql_free_result($result);
if (!mysql_drop_db("tmp_bd")) {
echo "Can't drop tempory DB \"tmp_bd\"!";
}
}
}
}
}
}
echo "</tr></table></table>";
}
if ($act == "mkdir") {
if ($mkdir != $d) {
if (file_exists($mkdir)) {
echo "<b>Make Dir \"" . htmlspecialchars($mkdir) . "\"</b>: object alredy exists";
} elseif (!mkdir($mkdir)) {
echo "<b>Make Dir \"" . htmlspecialchars($mkdir) . "\"</b>: access denied";
示例8: dropDatabase
function dropDatabase()
{
global $mysqlHandle, $dbname, $PHP_SELF;
mysql_drop_db($dbname, $mysqlHandle);
listDatabases();
}
示例9: dropDB
/**
* @param $db_name
* @return bool
*/
public function dropDB($db_name)
{
// for PHP4
if ($this->mode == self::MODE_MYSQL && function_exists('mysql_drop_db')) {
if (mysql_drop_db($db_name, $this->linkId)) {
return true;
}
} else {
$sql = "DROP DATABASE " . $this->escapeColumn(":DB") . ";";
$query = $this->createQuery()->queryExecute($sql, array("DB" => $db_name));
return $query->getResult() ? true : false;
}
return false;
}
示例10: mysql_create_db
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Admin top page</title>
</head>
<body background="rlaemb.JPG">
<!--create or drop database-->
<?php
include "admin_access.inc";
include 'rla_functions.inc';
if ($create) {
$action = $action;
if ($action == "Create a DB") {
$result = mysql_create_db($dbname, $contid);
} elseif ($action == "Drop a DB") {
$result = mysql_drop_db($dbname, $contid);
}
$outcome = '<h2><font size="5">';
if ($result) {
$outcome = "Database \"{$dbname}\" has been {$action} successfully.<br>";
} else {
$outcome = "Database \"{$dbname}\" has failed to be {$action} .<br>";
}
$outcome = $outcome . '</font></h2>';
$outcome = $outcome . '<a href="admin_dbedit_top.php">Create or drop Database</a>';
}
?>
<!--Change DB-->
<div align="center">
<center>
示例11: delete_database
/**
* Delete database
*
* @database - database name
* @returns true if succeed
*
*/
public function delete_database($tablename)
{
return @mysql_drop_db($tablename);
}
示例12: mysql_dropdb
function mysql_dropdb($database, $link = null)
{
return mysql_drop_db($database, $link);
}
示例13: printf
include_once "connect.inc";
$tmp = NULL;
$link = NULL;
// NOTE: again this test does not test all of the behaviour of the function
if (NULL !== ($tmp = mysql_drop_db())) {
printf("[001] Expecting NULL/NULL, got %s/%s\n", gettype($tmp), $tmp);
}
require 'table.inc';
if (!mysql_query('DROP DATABASE IF EXISTS mysqldropdb')) {
printf("[004] [%d] %s\n", mysql_errno($link), mysql_error($link));
}
if (!mysql_query('CREATE DATABASE mysqldropdb')) {
die(sprintf("[005] Skipping, can't create test database. [%d] %s\n", mysql_errno($link), mysql_error($link)));
}
if (true !== ($tmp = mysql_drop_db('mysqldropdb', $link))) {
printf("[006] Can't drop, got %s/%s. [%d] %s\n", gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));
}
if (false !== ($tmp = mysql_drop_db('mysqldropdb', $link))) {
printf("[007] Expecting boolean/false, got %s/%s. [%d] %s\n", gettype($tmp), $tmp, mysql_errno($link), mysql_error($link));
}
mysql_close($link);
print "done!\n";
require_once 'connect.inc';
if (!($link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket))) {
printf("[c001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", $host, $user, $db, $port, $socket);
}
if (!mysql_query("DROP DATABASE IF EXISTS mysqldropdb", $link)) {
printf("[c002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
mysql_close($link);
示例14: mysql_drop_db
<?php
mysql_drop_db("{$_GET['dbname']}");
示例15: while
print "<b>File content</b>:<br><br>";
for($i=0;$i<mysql_num_fields($result);$i++){
$name=mysql_field_name($result,$i);}
while($line=mysql_fetch_array($result, MYSQL_ASSOC)){
foreach ($line as $key =>$col_value) {
print htmlspecialchars($col_value)."<br>";}}
mysql_free_result($result);
mysql_drop_db("tmp_bd_file") or die("<font color=red>".mysql_error()."</font>");
}
print $copyr;
die;
}#end of read_file_safe_mode