Isn't it 'VALUES'? I must admit I very rarely use that syntax, I tend to use 'SET', so I may be wrong.
diafol
Rhod Gilbert Fan (ardav)
7,754 posts since Oct 2006
Reputation Points: 1,168
Solved Threads: 1,074
How about:
$sql = "INSERT INTO users (username, password, first_name, last_name) VALUES ('{$email}', '{$pw}', '{$fname}', '{$lname}')";
Although, I tend to do this:
$sql = "INSERT INTO users SET username='{$email}', password='{$pw}', first_name='{$fname}', last_name='{$lname}'";
The way I do it ensures that I don't forget a value of put the values in the wrong order. I'm just not organized enough! However it's a bit more difficult to do batch inserts.
diafol
Rhod Gilbert Fan (ardav)
7,754 posts since Oct 2006
Reputation Points: 1,168
Solved Threads: 1,074
Holy Moley, you'll hate your self for this :P You forgot a crucial line: mysql_query($sql); which should go on line 16. As your code stands, it doesn't execute the new SQL command, just sets the $sql variable.
Regarding the VALUE syntax, VALUE and VALUES are interchangeable.
humbug
Junior Poster in Training
93 posts since Oct 2005
Reputation Points: 20
Solved Threads: 13
Look at Humbug's answer again and insert the mysql_query. Should work then. Good spot Humbug.
diafol
Rhod Gilbert Fan (ardav)
7,754 posts since Oct 2006
Reputation Points: 1,168
Solved Threads: 1,074
Don't worry CFROG, I still do it. You skim over your code and remember what you should be there instead of reading what is there. Another set of eye's can spot it in no time. :P
humbug
Junior Poster in Training
93 posts since Oct 2005
Reputation Points: 20
Solved Threads: 13