Click to See Complete Forum and Search --> : php&mysql help plz


benzspida
04-02-2006, 05:17 PM
trying to create a new database with 4 table in php $ mysql
cant seem to get the script working can any one help plz

this is what i have done so far

<html>
<head>
<title>
mysql databser
</title>
</head>
<body>

<? php

$new_db = "testDB2";

$connection= @mysql_connect ("localhost", "craig", "1978")

die (mysql_error());

$result = @mysql_create_db ($new_db, $connection)

die (mysql_error());

if ($result) {
$msg = "<P>Database has been created!</p>";

print " $result";

}

?>




<p> <? echo "$msg"; ?></p>
</body>
</html>

chazzy
04-02-2006, 06:28 PM
when you use a die command, it should be
function_called() or die(error...);

sitehatchery
04-02-2006, 08:48 PM
I'm assuming that's not really your username and password to your database. If it is, it has now been broadcast to the world, and you might want to change it.

bathurst_guy
04-02-2006, 09:10 PM
By the looks of it this database is setup on his local machine, and I'm sure he has a firewall running so it doesn't matter so much. If it is his website database though, I would recommend changing the information.

benzspida
04-02-2006, 09:51 PM
no thats not my info just and example