I'm using an ubuntu server on an Amazon Web Services instance. I have the database set up and have been able to connect to other tables I've created except this new table "data" is giving me some problems. Through an if statement in the php code I know that I am connected to the database and that apparently the data is being submitted. However, when I go into phpmyadmin I see that the table is blank. Is there an issue with the code below? If not, what could this be?
<?php
if(isset($_POST['submit'])){
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$facebook = $_POST['facebook'];
$linkedin = $_POST['linkedin'];
$twitter = $_POST['twitter'];
$yourstory = $_POST['yourstory'];
$connection = mysqli_connect('xxxxxx.xxxxxxxxx.us-west-1.rds.amazonaws.com', 'root', 'welcome', 'awstutorial', 3306);
}
$query = "INSERT INTO data(name, email, phone, facebook, linkedin, twitter, yourstory)";
$query .= "VALUES ('$name', '$email', '$phone'. '$facebook', '$linkedin', '$twitter', '$yourstory')";
$result = mysqli_query($connection, $query);
if(!result) {
die('Query Failed' . mysqli_error());
} echo "Submitted!";
?>