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, and it looks like the solutions to similar issues are for older versions of php...I could be wrong through, I'm still relatively new to programming php. Anyway, I've tried to piece together the code based on what I've found, but it doesn't seem to be working - in this case, it executes whether the data is successfully inserted into the database or not.
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?
PHP:
$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
}
PHP:
if($mysqli->query){
Then it doesn't execute at all. I'm at a loss as to what to do here. Any advice?