Hello,
I have been trying to get this code to work, but it won't, and I can't figure out what is wrong. Its code that supposed to take form info, and insert it into the table "joblistings" here is the code I have below:
$jobtitle = $HTTP_POST_VARS['job_title'];
$currentuser = "$username";
$dayofyear = date("zy");
$jobtype = $HTTP_POST_VARS['job_type'];
$jobdescription = $HTTP_POST_VARS['job_description'];
$joblocation = $HTTP_POST_VARS['job_location'];
$companydescription = $HTTP_POST_VARS['compdescription'];
$jobwages = $HTTP_POST_VARS['job_wages'];
$jobage = $HTTP_POST_VARS['job_age'];
$jobother = $HTTP_POST_VARS['job_other'];
$jobstartdate = $HTTP_POST_VARS['job_start_date'];
mysql_connect ("host", "username", "password")
or die ("We couldn't connect to MySQL.");
mysql_select_db("databasename")
or die ("We could not open the database.");
$jobinsert = "INSERT INTO joblistings
(username,title,type,description,company_description,location,wages,age_require,other_require,start_date,dayofyear) VALUES
('$currentuser', '$jobtitle', '$jobtype', '$jobdescription', '$companydescription', '$joblocation', '$jobwages',
'$jobage', '$jobother', '$jobstartdate', '$dayofyear')";
mysql_query($jobinsert)
or die("could not insert info");
-It keeps saying "could not insert info", and its the truth. The data doesn't show up in the database. The only other field that I have in the database is "job_id", which is primary, and auto_increment. Anyone know what could be wrong? Thanks.
-Mike