if($inputError != true) { //insert query $sqlInsertQuery = "INSERT INTO users (address, email, firstName, lastName, password, phone) VALUES ('$address', '$email', '$fName', '$lName', '$salt', '$phone')"; $sqlReturn = "SELECT MAX(userID) FROM users"; if ($mysqli->query($sqlInsertQuery) === TRUE) { echo 'New employee record added with ID: ' . $mysqli->insert_id; echo 'Your login credentials were successfully created.'; } else { echo "ERROR: Could not execute query: $sqlInsertQuery. " . $mysqli->error; echo 'Unable to create your credentials.'; } //this is trying to get the most recent user id to insert it in my second table $my_id_array=mysqli_fetch_assoc($sqlInsertQuery); $my_id=$my_id_array['userid']; //$id = (int)$mysqli->query($sqlReturn); $sql2 = "INSERT INTO user2 (userid, phone) VALUES ('$my_id', '$phone')"; if ($mysqli->query($sql2) === TRUE) { echo 'Relation database call'; }
$sqlReturn = "SELECT MAX(userID) FROM users";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)