Jump to content

mysql inserting "--" from datepicker


AyKay47

Recommended Posts

Hey guys,

 

i have a weird issue that I have been trying to debug for almost an hour, can't wrap my brain around it.. I am using the Jquery UI datepicker with an input for a birthday, however even when I take this function out I am having issues which leads me to believe that it is something that mysql is doing.. When I try to insert the date into my table i receive the value of "--" instead of the date..my field to is set to VARCHAR which is why I am not understanding why it would be doing this....heres the relevant code.. in snippets

 

if(preg_match($pattern,$_POST['b_date'],$match)){
$birthday = $match[0]; //set birthday variable from preg_match, this works fine
        }...

$sqlcmd = "INSERT INTO members (first_name, last_name, email, password, b_date, gender, ip, date , randnum, activated)
	VALUES('$firstname','$lastname','$email','$dbpassword','$birthday','$gender','$ipaddress', '$date', '$randnum', 0)";
	$query = mysql_query($sqlcmd) or die (mysql_error()); //inserts the data fine, except for the "--"

 

comes from this input

 

<input type="text"  name="b_date" id="birthday" class="input_search_text2" />	

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.