How can I get this to work without getting the this warning in my error log. Missing argument 2 for wpdb::prepare()
I know I need to pass the second argument as noted in wp docs but having trouble getting it to work properly.
$insert = "INSERT IGNORE INTO " . $pps_new_table_name . "( post_id, post_author, create_date, hit_count, {$browser_column}, {$device_column} ) VALUES (" . $_POST['post_id'] . ",'" . $_POST['post_author'] . "','" . $create_date . "','1','1','1') ON DUPLICATE KEY UPDATE hit_count=hit_count + 1, {$browser_column}= {$browser_column} + 1, {$device_column}= {$device_column} + 1";
$results = $wpdb->query($wpdb->prepare($insert));
I needed to pass the variables in the VALUES area…
and add the array right after my $insert string moving my original VALUE strings below.
So in total it looks like this.