I had been searching all day long and could not find any solutions.
MY CODE:
<?php
include_once("php_includes/db_connect.php");
$tbl_users = "CREATE TABLE IF NOT EXISTS users (
id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(16) NOT NULL,
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
gender ENUM('m','f') NOT NULL,
country VARCHAR(255) NOT NULL,
userlevel ENUM('a','b','c','d' NOT NULL,
avatar VARCHAR(255) NULL,
ip VARCHAR(255) NOT NULL,
signup DATETIME NOT NULL,
lastlogin DATETIME NOT NULL
notescheck DATETIME NOT NULL,
activated ENUM('0','1') NOT NULL DEFAULT '0',
primary key (id),
UNIQUE KEY username (username, email)
)";
$query = mysqli_query($db_connect, $tbl_users); THIS IS LINE 20
if ($query === TRUE) {
echo "<h3>user table created OK </h3>";
} else {
echo "<h3>user table NOT created </h3>";
}
THE ERROR:
Warning: mysqli_query() expects parameter 1 to be mysqli, resource given in /home/www/URL/make_my_table.php on line 20
user table NOT created