I went through this a couple of days and I just canโt find the cause of the error. I do not get a php warning, just the "somethign went wrong" error handler instead of embedding. I know that the lovely young guys here are likely to notice this in a few seconds, for example, considering it is just an insertion expression, but im buggered. Thanks in advance.
include('core.inc.php'); $sql = 'INSERT INTO $resultsTable ( id, firstName, lastName, email, birthday, anniversary, location, campaign ) VALUES (NULL,?,?,?,?,?,?,?)'; $stmt = $mysql->stmt_init(); if ($stmt->prepare($sql)) { // bind parameters and execute statement $stmt->bind_param( 'sssssss', $_POST['fname'], $_POST['lname'], $_POST['email'], $_POST['birthday'], $_POST['anniversary'], $_POST['location'], $campaign ); $OK = $stmt->execute();} // return if successful or display error if ($OK) {$response = "Success";} else {$response ="Something went wrong.";} }
source share