Hi folks! I’m new on the forum, thought I’d get some help after I’ve been banging my head against the wall for a couple days trying to get a simple register code to work. I created the following table:
CREATE TABLE users (
id int(11) NOT NULL auto_increment,
username varchar(32) NOT NULL,
password varchar(32) NOT NULL,
email varchar(255) NOT NULL,
name varchar(64) NOT NULL,
aim varchar(16) NOT NULL,
admin int(11) NOT NULL default ‘0’,
time int(15) NOT NULL default ‘0’,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
And think I set up everything correctly (obviously not), so I keep getting the error unknown column ‘email’ in ‘where clause’. I looked this up on Google and from what I’m reading the user made some mistake setting up the table, however mine should be set up correctly to work with the where clause? Here’s the only where clause having to do with email on my register script:
[php]
if($email){
$sql2 = “SELECT * FROM users WHERE email=’.$email.’”;
$res2 = mysql_query($sql2) or die(mysql_error());
if(mysql_num_rows($res2) > 0){
$errors[] = "The e-mail address you supplied is already in use of another user!";
}
}
[/php]
I guess I’m just confused as to what I did wrong here. Any explanations would be helpful!