Forum Moderators: open
any suggestions?
I have been over this a thousand times and cant find my error.
Form :
<form action="add_contact.php" method="post">
Name: <input type="text" name="name"/>
Address1: <input type="text" name="Address1"/>
Address2: <input type="text" name="Address2"/>
Address3: <input type="text" name="Address3"/>
suburb: <input type="text" name="Suburb"/>
City: <input type="text" name="City"/>
Area: <input type="text" name="Area"/>
Province: <input type="text" name="Province"/>
Country: <input type="text" name="Country"/>
Tel: <input type="number" name="Tel"/>
Rooms: <input type="number" name="Rooms"/>
Description: <input type="text" name="Description"/>
POBox: <input type="number" name="POBox"/>
<input type="Submit"/>
Php :
$dbh = mysql_connect($DBhost,$DBuser) or die("Unable to connect to database");
Echo "connected to mysql";
$db_selected = mysql_select_db('Hotel',$dbh) or die(mysql_error());
Echo "dbase selected";
$sql = Mysql_query("INSERT INTO Hotel_detail (name,address1,address2,address3,suburb,city,area,
province,country,tel,rooms,description,pobox) VALUES ('".$_POST[name
]."','".$_POST[address1]."','".$_POST[
address2]."','".$_POST[address3]."','".$_POST[suburb]."','".$_POST[city]."','".$_POST[area]."','".$_POST[
province]."','".$_POST[country]."','".$_POST[tel]."','".$_POST[rooms]."','".$_POST[description]."','".
$_POST[pobox]."')") or die(mysql_error());
$db_selected = mysql_select_db('Hotel',$dbh) or die(mysql_error());
Echo "dbase selected";