This code is perfectly working in local host! but when i try this in web server, its not working! Connection Established! By Database Creation Failed!
I tried this in
www.t35.com - Free web space with mysql support!
Help please
<html>
<head>
<title>Create Data Base</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?Php
echo ("Attempt To Create and Dump New Database FANew");
/*-----------------------------------------------*\
| Opening Connection |
\*-----------------------------------------------*/
$con_str = @mysql_connect();
if (!$con_str)
echo ("connection failed") ;
else
echo ("Connection Made successfully!") ;
/*-----------------------------------------------*\
| Checking for the Existance of Dbs of same name |
\*-----------------------------------------------*/
$database["sql"] = "DROP DATABASE IF EXISTS `fanew`";
if ( mysql_query($database["sql"]) ,$con_str )
echo ("<br> Checked and Cleared Existing Database of the same name") ;
else
echo ("<br>Attempt to check dabase of same name failed") ;
/*-----------------------------------------------*\
| Creating database FaNew |
\*-----------------------------------------------*/
$database["database"] = "fanew";
if ( mysql_create_db($database["database"]) ,$con_str )
echo ("<br>database created successfully");
else
echo ("<br>Attempt to create new database failed <br>" );