Make WordPress Core


Ignore:
Timestamp:
08/20/2016 01:16:33 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Docs: Correct usage examples for wpdb::prepare(), which should not be called statically.

Props TJNowell.
Fixes #37744.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r38133 r38289  
    12591259         * Both %d and %s should be left unquoted in the query string.
    12601260         *
    1261          *     wpdb::prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 )
    1262          *     wpdb::prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
     1261         *     $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d", 'foo', 1337 );
     1262         *     $wpdb->prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' );
    12631263         *
    12641264         * @link https://secure.php.net/sprintf Description of syntax.
Note: See TracChangeset for help on using the changeset viewer.