07-19-2011, 06:04 PM
(07-19-2011, 04:35 PM)roperson Wrote: When using MySQL, wouldn't this create multi-databases?
Code:<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die(mysql_error());
}
if (mysql_query("CREATE DATABASE my_db",$con))
{
echo "Database created";
}
else
{
echo mysql_error();
}
mysql_close($con);
?>
One every time the page is loaded?
I think it would cause an error, because you can't have 2 databases with the same name.