I can use the REPLACE INTO instead of INSERT, UPDATE and DELETE perfectly, but the object returns NULL. This works, but $add returns null; ` $add = $db->query("REPLACE INTO ads (fk_user, ad_title, ad_description, ad_files, ad_type, ad_mode, ad_reward, ad_location, ad_cdate, ad_udate, ad_status, ad_slug, ad_tags, ad_solved, ad_reports) VALUES (1, 'title', 'description', 'files', 1, 1, 1.12, 'location', NOW(), NULL, 1, 'slug', 'tags', 1, 0)"); `