You may execute multiple queries with the mysqli interface requires a call to mysqli_multi_query().
__avd
Posting Genius (adatapost)
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
here is example
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// Create database
if (mysql_query("CREATE DATABASE wm",$con))
{
echo "Database created";
}
else
{
echo "Error creating database: " . mysql_error();
}
// Create table
mysql_select_db("wm", $con);
$sql = "CREATE TABLE Persons
(
username varchar(25),
password varchar(15),
email varchar
)";
// Execute query
mysql_query($sql,$con);
mysql_close($con);
?>
enbeeone3
Junior Poster in Training
58 posts since Jan 2009
Reputation Points: 10
Solved Threads: 1