[wp-trac] [WordPress Trac] #23064: support str_to_date on $wpdb->prepare

WordPress Trac noreply at wordpress.org
Fri Dec 28 04:30:28 UTC 2012


#23064: support str_to_date on $wpdb->prepare
--------------------------------------+--------------------------
 Reporter:  jperelli                  |       Type:  defect (bug)
   Status:  new                       |   Priority:  normal
Milestone:  Awaiting Review           |  Component:  Database
  Version:  3.4.2                     |   Severity:  normal
 Keywords:  needs-patch dev-feedback  |
--------------------------------------+--------------------------
 I was trying to use the function str_to_date from mysql in a SQL raw query
 using $wpdb to query de db.

 I realized that $wpdb->prepare is not letting the query execute because of
 the presence of str_to_date

 Steps to reproduce:

 global $wpdb;

 echo $wpdb->get_var($wpdb->prepare("select STR_TO_DATE('200442 Monday',
 '%X%V %W');"));

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23064>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list