mysql/php inserting into a table
morning/afternoon all
ok have a problem at the mo i have a form that get passed to a script and the information is up dated in the database table now i have three problems.
First:
i have a form text box so you can write more information ie a description which passes to the script now this is the code im using to update
if (isset($_POST['desc'])){
$value_desc = trim($_POST['desc']);
if (!empty($value_desc)){
$query_desc = "UPDATE hotels SET description = '$value_desc' WHERE name = '$id'";
mysql_query($query_desc) or die(mysql_error());
}
}
and then nothing happens as if its not there
secound:
when inserting a new recored into the database table using this code i get the same problem
$query = "INSERT INTO hotels(name, address1, address2, town, county, postcode, tel, fax, extra1, extra2, email,www, pageViews, wwwClick, imageAlt, description) VALUES ('$name', '$address1', '$address2', '$town', '$county', '$postcode', '$tel', '$fax', '$extra1', '$extra2', '$email', '$www', '$pageViews', '$wwwClick', '$imageAlt', '$desc')";
MYSQL_QUERY($query) or die(mysql_error());
and last but not least whats the best coloum type in a database to use to store numbers ie like 89.0.0.0.0.0
thanks for your time hope this make sensis
cheers
mark
|