AirBoss36 Posted September 27, 2009 Share Posted September 27, 2009 I am building a game website and I am working on my user registration form. Everything was working fine until I tried to add a function to include the registration date. The form is processed and it looks like it has registered the user, but there is no entry placed into the database. $join = date('Y-m-d'); mysql_query("INSERT INTO users (user_name, user_login, user_pw, user_email, user_bmonth, user_bday, user_byear, user_sex, join) VALUES ('$name', '$login', '$pass', '$em', '$_POST[bmonth]', '$_POST[bday]', '$_POST[byear]', '$_POST[sex]', '$join')"); The "join" field type is set to DATE. What am I doing wrong? Thanks Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 27, 2009 Share Posted September 27, 2009 If you were using mysql_error() to debug this, you would get a SQL syntax error at the join column name in the query statement. join is a reserved keyword and should not be used as a column name. You either need to rename it or enclose it in back-ticks ` every place it gets used as a column name in a query. Quote Link to comment Share on other sites More sharing options...
AirBoss36 Posted September 27, 2009 Author Share Posted September 27, 2009 Thank you, that fixed the problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.