Data Entry Form to Database Issue

I am a beginner php guy but I can figure out most things. I created this Form and when I submit data the result I get doesn’t coincide with the data chosen in the form.

I get

1 - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0
2 - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0
3 - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0
4 - 0 - - 0 - 0 - 0 - 0 - 0 - 0 - 0

and so on

Can anybody help me figure out how to enter the correct data? What am I missing??? I am about 1 cup of coffee short from dropping my computer from the Sears Tower. Anybody ever see the movie Office Space where they went postal on the Copier/printer??? That’s how I feel right about now…AHHHHHH!H!!!H!H!H!H!H

[code]<?php
####################################################################
################ DATABASE CONFIGURE ##############################
####################################################################
$hostname = “localhost”;
$db_user = “";
$db_password = "
”;
$db_table = “submit”;

STOP HERE

####################################################################

THIS CODE IS USED TO CONNECT TO THE MYSQL DATABASE

$db = mysql_connect($hostname, $db_user, $db_password);
mysql_select_db ("********") or die (mysql_error());
?>

Kayak Wars Submission Form Kayak Wars Submission Form
<?php if (isset($_REQUEST['Submit'])) { # THIS CODE TELLS MYSQL TO INSERT THE DATA FROM THE FORM INTO YOUR MYSQL TABLE $sql = "INSERT INTO $db_table(submit_id, team, angler, species, quantity, kayak, yyyy, mm, dd, water) values ('$submit_id', '$team', '$angler', '$species', '$quantity', '$kayak', '$yyyy', '$mm', '$dd', '$water')"; if($result = mysql_query($sql ,$db)) { echo "Thank you, Your information has been entered into the database"; } else { echo "ERROR: ".mysql_error(); }

}
else
{
?>

Team
Select a Team Rockstar Plastic Pirates Third Coast Hustlas Wildy
Angler
Select Angler
Species
Select Species Red Drum Trout Snook Shark Black Drum Snapper King Mackerel Grouper Cobia (Ling) Flounder Tarpon Tripletail Permit Blackfin Tuna Yellowfin Tuna Barracuda Bonefish Dorado Wahoo Billfish Quantity
Kayak
Select Kayak Malibu 2 XL Malibu 2 Cobra Fish N Dive Scrambler XT Speck Hobie
Date of catch
2008 2009 2010 2011 2012 Select Month January February March April May June July August September October November December Select day 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Body of Water
Select Body of Water Upper Coast Middle Coast Lower Coast
<?php } ?> [/code]

Can you narrow the question down a bit and provide more details. Providing the results without knowing what the “Select” was is not really helpful.

Also please narrow down the section of code that you think the problem is. You have over 200 lines of code to chug through. If you could narrow it down that would make it easier to help you.

Did you try any debugging? What was the results? This would also be helpful so we don’t “Duplicate” things that you have already tried.

Thanks,

I figured it out.

I just needed a break for a while…took my mind off and took a break and then found my problem.

I forgot to define my variables.

i.e.

$team = $_POST[‘team’]

etc.

Thanks for looking.

Sponsor our Newsletter | Privacy Policy | Terms of Service