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? 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.. 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')"; 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
Archived
This topic is now archived and is closed to further replies.