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 Link to comment https://forums.phpfreaks.com/topic/175693-solved-problem-with-date-being-passed-into-mysql-table/ 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. Link to comment https://forums.phpfreaks.com/topic/175693-solved-problem-with-date-being-passed-into-mysql-table/#findComment-925823 Share on other sites More sharing options...
AirBoss36 Posted September 27, 2009 Author Share Posted September 27, 2009 Thank you, that fixed the problem. Link to comment https://forums.phpfreaks.com/topic/175693-solved-problem-with-date-being-passed-into-mysql-table/#findComment-925824 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.