How is it is can not create a database on phpMyAdmin? I connect to PHP just fine, no error message. But when I am trying to create a database so phpMyAdmin, I keep getting error. In case it matters I have one page with a <form>
and has a submit to my second.php
file where my database code is (second.php
is shown below).
I am pretty much trying to display the database in phpMyAdmin but nothing shows up:
<html>
<body>
<?php
$con = mysqli_connect("localhost", "user", "password");
if(!$con){
echo "could not connect";
} else {
echo "good connection";
}
//creation of database
$sql= 'CREATE DATABASE project';
if(mysql_query($sql,$con)){
echo 'DB created succesfully';
} else {
echo 'error creating DB' . mysql_errno();
}
?>
</body>
</html>