I'm still pretty new to mysql and php and have looked at this code over and over again and can't see the error. Any help would be appreciated. Code below...
<?php
$link = mysql_connect('mydatabase.com', 'database', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db(mydatabase) or die(mysql_error());
// Get values from form
$user_type=$_POST['user_type'];
$ven_name=$_POST['ven_name'];
$address=$_POST['address'];
$email_addy=$_POST['email_addy'];
$phone=$_POST['phone'];
$class=$_POST['class'];
// Insert data into mysql
$sql="INSERT INTO vendor_games(user_type, ven_name, address, email_addy, phone, class) VALUES('$user_type', '$ven_name', '$address', '$email_addy', '$phone', '$class')"
$result = mysql_query($sql);
// if successfully insert data into database, displays message "Successful".
if($result){
echo "Successful";
echo "<BR>";
echo "<a href='/bike_show.html'>Back to Bike Show Page</a>";
}
else {
echo "ERROR";
}
// close connection
mysql_close();
?>