Skip to content

Commit

Permalink
Correct SQL UPDATE format
Browse files Browse the repository at this point in the history
  • Loading branch information
sheabunge committed Jan 25, 2020
1 parent 6be5040 commit 1424bb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/snippet-ops.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function activate_snippets( array $ids, $multisite = null ) {

/* Build a SQL query containing all the valid snippet IDs and activate the valid snippets */
$ids_format = implode( ',', array_fill( 0, count( $valid_ids ), '%d' ) );
$sql = sprintf( 'UPDATE %s SET active = 1 AND modified = %%s WHERE id IN (%s);', $table, $ids_format );
$sql = sprintf( 'UPDATE %s SET active = 1, modified = %%s WHERE id IN (%s);', $table, $ids_format );

array_unshift( $valid_ids, Code_Snippet::current_date() );
$wpdb->query( $wpdb->prepare( $sql, $valid_ids ) );
Expand Down

0 comments on commit 1424bb0

Please sign in to comment.