#41929 closed defect (bug) (duplicate)
Bug wpdb prepare 4.8.2
| Reported by: | victorfreitas | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | 4.8.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Hello @victorfreitas, numbered placeholders are not supported by
wpdb::prepare(), see #41926 and #41925.