Oracle 5.0 Reference Manual page 2270

Table of Contents

Advertisement

Examples
Example 20.30.
The function
CREATE DATABASE
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
$sql = 'CREATE DATABASE my_db';
if (mysql_query($sql, $link)) {
echo "Database my_db created successfully\n";
} else {
echo 'Error creating database: ' . mysql_error() . "\n";
}
?>
The above example will output something similar to:
Database my_db created successfully
Notes
See Also
mysql_query
mysql_select_db
20.7.2.5.6.
mysql_data_seek
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysql_data_seek
Move internal result pointer
Original MySQL API (Mysql)
mysql_create_db
is deprecated. It is preferable to use
mysql_create_db
statement instead.
Note
For backward compatibility, the following deprecated alias may be used:
mysql_createdb
Note
This function will not be available if the MySQL extension was built against a
MySQL 4.x client library.
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
also
MySQL: choosing an API
Alternatives to this function include:
mysqli_data_seek
PDO::FETCH_ORI_ABS
alternative example
MySQLi
or
PDO_MySQL
guide and
2250
mysql_query
extension should be used. See
related FAQ
for more information.
to issue an sql

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents