Hello everyone,
Ive been working with php the past couple of weeks and am starting to get into my sql, I have decided to try to create an admin to connect to mysql. Anyways first thing is that when I created my mysql tables I can view them in my php admin, I can see all the information i have plugged but only i get the error I created in the if else statement such as :
<?php
require "connect_to_mysql.php";
$sqlCommand = "CREATE TABLE admin(
id int(11) NOT NULL auto_increment,
username varchar(24) NOT NULL,
password varchar(24) NOT NULL,
last_log_date date NOT NULL,
PRIMARY KEY(id),
UNIQUE KEY username (username)
)";
if(mysql_query($sqlCommand)){
echo 'your admin table has been created successfully congrats';
}else {
echo 'you created an error please try again by reworking code';
}
?>
the problem is that I always end up with the error "you created an error" warning that i created in the if else statement. I have tested to see if I connect to the data base and I am connected I can see the table itself on the php my admin, I am using 000hosting for this hopefully someone can guide me to the right direction
Thank everyone :0