Comunitatea PHP Romania
 

 
mysql_create_db

mysql_create_db

(PHP 3, PHP 4 , PHP 5)

mysql_create_db -- Create a MySQL database

Description

bool mysql_create_db ( string database_name [, resource link_identifier])

mysql_create_db() attempts to create a new database on the server associated with the specified link identifier.

Returnează TRUE în caz de succes, FALSE în caz contrar.

Exemplu 1. MySQL create database example

<?php
$link
= mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!
$link) {
    die(
'Could not connect: ' . mysql_error());
}

if (
mysql_create_db('my_db')) {
    echo
"Database created successfully\n";
} else {
    echo
'Error creating database: ' . mysql_error() . "\n";
}
?>

For downwards compatibility mysql_createdb() can also be used. This is deprecated, however.

Notã: The function mysql_create_db() is deprecated. It is preferable to use mysql_query() to issue a SQL CREATE DATABASE Statement instead.

Avertisment

This function will not be available if the MySQL extension was built against a MySQL 4.x client library.

See also mysql_query().

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Electricity Suppliers | MPAA | Loans | Electricity Suppliers | Ringtones
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis