date - How can I use a MySQL function in my PHP query code? -
i'm trying convert string "date" value submitted form actual date while doing insert query. thought use mysql function str_to_date, i'm getting error message.
here's code; joomla site, jrequest::getvar calls joomla's way of getting submitted _post variables.
$query = "insert jos_customers_addresses (customer_id,nickname,birthdate) values (" .$db->quote($useracctid)."," .$db->quote($nickname)."," .$db->quote(str_to_date(jrequest::getvar('birthdate'),'%m/%d/%y')) .")";
i've tried birthdate line without $db->quote, got same error. error message is:
fatal error: call undefined function str_to_date() in /var/www/html/mysite.com/components/com_arrcard/models/checkoutpay.php on line 156
where line 156 line containing str_to_date call. ideas?
put in query, not code.
."str_to_date(".$db->quote(jrequest::getvar('birthdate')).",'%m/%d/%y')"
Comments
Post a Comment