I'm trying to execute something only of the data is successfully inserted into the database, but I'm clearly doing something wrong. I've done as bit of digging around the forum, and it looks like the solutions to similar issues are for older versions of php...I could be wrong through, I'm just at the beginning of learning php. Anyway, I've tried to piece together the code based on what I've found on the forum, but it doesn't seem to be working - in this case, it executes whether the data is successfully inserted into the database or not.
Code: Select all
$mysqli->query("INSERT INTO ag_pages (page_date, page_type, page_url, page_keyword, page_title, page_content) VALUES ('$page_date', '$page_type', '$new_page_url', '$new_page_keyword', '$new_page_title', '$new_page_content')");
if($mysqli){
stuff to excecute here
}
If I change it to
Then it doesn't execute at all. I'm at a loss as to what to do here. Any advice?