I'm new to learning PHP and I checked my work online but I get this error message: Warning: mysql_query() expects parameter 2 to be resource, object given in C:\wamp64\www\Lessons\createdatabase.php on line 12. I checked through all of the answers on stack and nothing looks like the code i'm working with. I'm not asking if mysql & mysqli can work together I just need a solution to this code so that it can finally work....I don't know what to do and the article referenced at the top does not help me.....Here is the code I currently have:
<html>
<head>
</head>
<body>
<?php
$con = mysqli_connect("localhost","Matt","password");
if (!$con){
die("Can not connect: " . mysql_error());
}
if (mysql_query("CREATE DATABASE snippets",$con)){
echo "Your Database was created sucessfully";
} else echo "Error: " . mysql_error();
mysqli_close($con);
?>
</body>
</html>
Any advice would really help me out. Thanks