#41929 closed defect (bug) (duplicate)
Bug wpdb prepare 4.8.2
Reported by: | victorfreitas | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8.2 |
Component: | Query | Keywords: | |
Focuses: | Cc: |
Description
After updating to 4.8.2, my SQL query in prepare method not working.
Code example:
<?php $results = $wpdb->get_results( $wpdb->prepare( "SELECT `ID` FROM `{$wpdb->posts}` WHERE `ID` = %1\$d AND `post_status` = '%2\$s' ", 100, 'publish' ) );
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hello @victorfreitas, numbered placeholders are not supported by
wpdb::prepare()
, see #41926 and #41925.