boyyo Posted April 29, 2011 Share Posted April 29, 2011 Whats wrong with this code ? <?php $dbc = mysqli_connect('localhost', 'boyyo_boyyo', 'KiaNNa11', 'boyyo_aliendatabase') or die('Error connecting to MySQL server.'); $first_name = $_POST['firstname']; $last_name = $_POST['lastname']; $email = $_POST['email']; $query = "INSERT INTO email_list (first_name, last_name, email) " . "VALUES ('$first_name', '$last)name', '$email')"; mysqli_query($dbc, $query ) or die('Error querying database.'); echo 'Customer added. ' ; mysqli_close($dbc); ?> I have no idea whats wrong with this code? Quote Link to comment https://forums.phpfreaks.com/topic/235134-whats-wrong-with-this-code/ Share on other sites More sharing options...
fugix Posted April 29, 2011 Share Posted April 29, 2011 please encase your php code using the code tags.. Quote Link to comment https://forums.phpfreaks.com/topic/235134-whats-wrong-with-this-code/#findComment-1208417 Share on other sites More sharing options...
fugix Posted April 29, 2011 Share Posted April 29, 2011 this "VALUES ('$first_name', '$last)name', '$email')"; should be "VALUES ('$first_name', '$last_name', '$email')"; Quote Link to comment https://forums.phpfreaks.com/topic/235134-whats-wrong-with-this-code/#findComment-1208418 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.