Ok this is where I am at right now. I went back and cleaned up the code and now that I am starting to feel better things are popping out at me. last run gave me this
Array
(
[name] => This Cache
[cache_type] => traditional
[cache_size] => micro
[date_placed_month] => November
[date_placed_day] => 18
[date_placed_year] => 2005
[cordv] => N
[lat1] => 12
[lat2] => 34.456
[cordh] => W
[long1] => 096
[long2] => 12.345
[zipcode] => 75071
[city] => Mesquite
[park] => Abilene S.P.
[difficulty] => 1
[terrain] => 1
[desc_short] => test
[desc_long] => test
[hint] => test
[agreecheck] => on
)
Column count doesn't match value count at row 1
Don't know what "Column count doesn't match value count at row 1" means. When cleaning things up and noticed some small errors and typos that I am sure were the problem. All of them were working except for like 3 feilds and I think I have them fixed, but when I tried to run it again I got the above error. Here is the cleaned up php
<?
include("dbinfo.inc.php");
echo '<pre>' . print_r($_POST, true) . '</pre>';
$nickname=$_POST['name'];
$str_nickname = $_POST['name'];
$str_nickname = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_nickname);
$str_cache_type = $_POST['cache_type'];
$str_cache_type = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_cache_type);
$str_cache_size = $_POST['cache_size'];
$str_cache_size = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_cache_size);
$str_active = $_POST['active'];
$str_active = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_active);
$str_date_placed_month = $_POST['date_placed_month'];
$str_date_placed_month = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_date_placed_month);
$str_date_placed_day = $_POST['date_placed_day'];
$str_date_placed_day = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_date_placed_day);
$str_date_placed_year = $_POST['date_placed_year'];
$str_date_placed_year = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_date_placed_year);
$str_cordv = $_POST['cordv'];
$str_cordv = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_cordv);
$str_lat1 = $_POST['lat1'];
$str_lat1 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_lat1);
$str_lat2 = $_POST['lat2'];
$str_lat2 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_lat2);
$str_cordh = $_POST['cordh'];
$str_cordh = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_cordh);
$str_long1 = $_POST['long1'];
$str_long1 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_long1);
$str_long2 = $_POST['long2'];
$str_long2 = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_long2);
$str_zipcode = $_POST['zipcode'];
$str_zipcode = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_zipcode);
$str_city = $_POST['city'];
$str_city = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_city);
$str_park = $_POST['park'];
$str_park = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_park);
$str_difficulty = $_POST['difficulty'];
$str_difficulty = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_difficulty);
$str_terrain = $_POST['terrain'];
$str_terrain = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_terrain);
$str_desc_short = $_POST['desc_short'];
$str_desc_short = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_desc_short);
$str_desc_long = $_POST['desc_long'];
$str_desc_long = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_desc_long);
$str_hint = $_POST['hint'];
$str_hint = preg_replace("#\<.+?\>(.+?)\</.+?\>#is", "\\1", $str_hint);
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = mysql_query("INSERT INTO geocaches (nickname, cache_type, cache_size, active, date_placed_month, date_placed_day, date_placed_year, cordv, lat1, lat2, cordh, long1, long2, city, difficulty, terrain, desc_short, desc_long, hint ) VALUES ('$str_nickname','$str_cache_type','$str_cache_size','$str_active','$str_date_placed_month','$str_date_placed_day','$str_date_placed_year','$str_cordv',
'$str_lat1','$str_lat2','$str_cordh','$str_long1','$str_long2','$str_zipcode','$str_city','$str_difficulty','$str_terrain','$str_desc_short','$str_desc_long','$str_hint')")or die (mysql_error());
$gettcid= mysql_query("SELECT * FROM geocaches WHERE tcid ORDER BY tcid DESC ")or die(mysql_error());
$tc = mysql_fetch_array($gettcid);
$tc_result = $tc['tcid'] + 001;
$tc2= mysql_query("INSERT INTO geocaches (tcid) VALUES ('$tc_result')");
{
echo "Thank You, Your listing as been submited. It will be reviewed by a moderator within 24hrs. Should your submission need further information prior to listing, a moderator will contact you. You may check the status of the geocache by visting the cache page at anytime.";
}
mysql_close();
?>
I remember now why I had two lats and two longs. Because I was trying to hoping I could use the vaule from two forms to insert into one feild. Reason being is because of the coordinates being in MinDeg so it would be N or S 34 12.1234 etc. So what I did is went back and made a feild for each cordh lat1 lat2 and the same for long. That all works now unless thier is a way to get all that info into one feild, that would be awsome? So if someone could explain the "Column count doesn't match value count at row 1" that would be great since I think I almost have this page nailed out. Thanks for the help.