Jump to content

can you spot the not?


ok

Recommended Posts

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?

Link to comment
Share on other sites

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())";

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.