Connect MySQL database via PHP
$conn = mysql_connect ("localhost", "root", "password") or Die ("Unable to connect to database");
mysql_select_db ("table", $conn) or Die ("data source not found");
-----------------------------------------------------------------------
create a MySQL database from PHP
$conn = mysql_connect ("localhost", "root", "password") or Die ("Unable to connect to database");
mysql_create_db ("Webjx") or Die ("Unable to create database");
$SQLSTR = "CREATE Database OTHER_WEBJX";
mysql_query ($sqlstr) or Die ("Cannot create, general check permissions, etc.");
----------------------------------------------------------------------------
Create a table for MySQL
$conn = mysql_connect ("localhost", "root", "password") or Die ("Unable to connect to database");
mysql_select_db ("Webjx", $conn) or die ("Unable to connect to database Webjx");
$sql = "CREATE Table webjx_table (
IDS integer NOT NULL auto_increment,
Primary KEY (IDS)
)";
$mysql _query ($sql) or Die (Mysql_error ());
http://www.bkjia.com/PHPjc/509206.html www.bkjia.com true http://www.bkjia.com/PHPjc/509206.html techarticle connect MySQL database via php $conn =mysql_connect ("localhost", "root", "password") Ordie ("Unable to connect to database"), mysql_select_db ("table", $conn) Ordie ("Data source not found"); ---------...