Forum Moderators: open

Message Too Old, No Replies

Cant post more than one field to database

help

         

malcolmcroucher

12:49 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



I am having some trouble here and have resorted to asking for help. I am only posting one field ito my database and i dont know why ....

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";

malcolmcroucher

1:17 pm on Nov 29, 2007 (gmt 0)

10+ Year Member



I added serilize and seem to be able to post but it comes up with some gobbly de gook .....

maybe that is the answer ...
i have not tried to unserialise yet though ..