wpdb prepare insert table doesn’t work

I’m pretty sure that first SQL query isn’t correct SQL (insert has different syntax) 😉 It should be:

INSERT INTO {$wpdb->prefix}awpcp_adphotos (ad_id, image_name, disabled, isprimary) VALUES (%d, %s, %d,%d)

In second example, I’m almost sure that ad_id is not string, and image_name is not a number. Of cours I’m only guessing, because I haven’t seen this table definition.

Remember that you can always turn error reporting for wpdb on. Just put this line in your code and you will see wpdb errors:

$wpdb->show_errors();