ok Posted September 3, 2008 Share Posted September 3, 2008 what's wrong with these codes? $query = "INSERT INTO user_join (user_name, email, invited_by, date_join) VALUES ('$ufull_name', '$uemail', '$rfull_name', 'now()'"; mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); Thank you? Quote Link to comment https://forums.phpfreaks.com/topic/122484-can-you-spot-the-not/ Share on other sites More sharing options...
pocobueno1388 Posted September 3, 2008 Share Posted September 3, 2008 What's the error? My guess to why it's not working is because you have the NOW() function in quotes. Also, your missing a parenthesis from the end. So try this instead $query = "INSERT INTO user_join (user_name, email, invited_by, date_join) VALUES ('$ufull_name', '$uemail', '$rfull_name', NOW())"; Quote Link to comment https://forums.phpfreaks.com/topic/122484-can-you-spot-the-not/#findComment-632462 Share on other sites More sharing options...
cyrixware Posted September 3, 2008 Share Posted September 3, 2008 Wer did you get the now()? what if create a variable for the date() and pass the date() to the variable.... instead of now in your query change it to the variable you declared for the date. Quote Link to comment https://forums.phpfreaks.com/topic/122484-can-you-spot-the-not/#findComment-632480 Share on other sites More sharing options...
pocobueno1388 Posted September 3, 2008 Share Posted September 3, 2008 Wer did you get the now()? what if create a variable for the date() and pass the date() to the variable.... instead of now in your query change it to the variable you declared for the date. NOW() is a MySQL function that inserts the current date/time into a datetime field in the database. So they are using it perfectly fine, no need to declare a date variable. Quote Link to comment https://forums.phpfreaks.com/topic/122484-can-you-spot-the-not/#findComment-632555 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.