hi, this is my first try at php and just need to know is this code right as im getting errors but dont know if its my code or the sever side
<?php
//CONNECT MYSQL and SELECT TABLE;
$host = "localhost"; //host name;
$username = "test"; //mysql server login name;
$password = "test"; //mysql server login password;
//database Name;
$database = "test";
//PREPARE sql statement;
$sql1 = "CREATE DATABASE $database";
//EXECUTE sql statement;
$exq1 = mysql_query($sql1);
//reply us the database is created or not;
if($exq1) {
echo "database created";
} else {
echo "error while create database";
}
?>
<?php
//CONNECT MYSQL and SELECT TABLE;
$host = "localhost"; //host name;
$username = "test"; //mysql server login name;
$password = "test"; //mysql server login password;
//database Name;
$database = "test";
//PREPARE sql statement;
$sql1 = "CREATE DATABASE $database";
//EXECUTE sql statement;
$exq1 = mysql_query($sql1);
//reply us the database is created or not;
if($exq1) {
echo "database created";
} else {
echo "error while create database";
}
?>
Comment