Hello, I sure hope someone here can help me. I have been trying to get this work for a week and I am new to php and the whole MqSQL but it is very interesting and learn fast. I have a couple of sites that use php and MySQL but this is my first try at writing something from scratch.
I am need a build a drop down box that has about 6 options to enter into the DB. That's the easy part which I have already done. here is how it looks.
<form name="cache_type" action="cache_types.php" method="POST">
<div align="left">
<select name="cache_type">
<option value="traditional">Traditional Cache</option>
<option value="multi">Multi-Stage Cache (Multicache)</option>
<option value="mysterypuzzle">Mystery/Puzzle Cache</option>
<option value="letterbox">Letterbox (Hybrid)</option>
<option value="geocacheevent">Geocaching Event (Event Cache)</option>
<option value="CITO">Cache In Trash Out Event</option>
</select>
<br /><input value="Submit" name="Submit" type="submit">
</div>
</form>
Here is the PHP page that the form is calling
<?
include("dbinfo.inc.php");
$str_cache_types = $_POST['cache_type'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = mysql_query("INSERT INTO cache_types (id_field, cache_types_field) VALUES ($number_value,$cache_types)");
{
echo "Thanks for your help while we continue to develop. Click the Home button in the upper left corner to return back to the Home Page.";
}
mysql_close();
?>
Here is my DB setup
TABLE cache_types
(id int(6) NOT NULL auto_increment,
cache_types enum('traditional','multi','mysterypuzzle','letterbox','geocacheevent','CITO') default NULL,
PRIMARY KEY (id)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
This is the info I have got up to this point on it but don't know if it's correct. The werid thing is I don't get any errors, but nothing is entered into the table. Here is the url of wher the form is that I am working on.
http://www.texascaching.com/type2.html
I hope someone can help, I am in dire need to get this working and I would be much apprecitive.
-Thanks