0
How to create database
I am newbie in php how to create database
4 odpowiedzi
0
Anyone
0
you can't create database from PHP but you can create it through many ways :
1 - From application that deals with your sql server such as phpMyAdmin, or Mysql-Workbench .
2 - from terminal just access you sql server and type "CREATE DATABSE <your DB name>".
0
Try this localhost/phpmyadmin
0
$dbhost = 'localhost:3036'; $dbuser = 'root'; $dbpass = 'rootpassword'; $conn = mysql_connect($dbhost, $dbuser, $dbpass); if(! $conn ) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; $sql = 'CREATE Database test_db'; $retval = mysql_query( $sql, $conn ); if(! $retval ) { die('Could not create database: ' . mysql_error()); } echo "Database test_db created successfully\n"; mysql_close($conn);