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
https://forums.phpfreaks.com/topic/243206-mysql-inserting-from-datepicker/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.