Re: FORM not inserting data
| From: | Jennifer Downey | Date: | Fri, 26 Apr 2002 03:07:05 +0000 |
| Subject: | Re: FORM not inserting data | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18821@lists.php.net to get a copy of this message | ||
As many people have told me and I have just now got it through my thick head
try either echoing the query or use
$result = mysql_query($sql) or die(mysql_error());
You will find out what is being passed (or not passed) through your
variables or find out what error you are getting.
HTH
Jennifer
"Neil" <aveloop@neilmar.com> wrote in message
news:002501c1ecc2$8b1e16a0$1bc5fea9@neilmar...
Help. Help
Please, Please tell me what I am doing wrong here...I have a form to input
data but it is not posting it....here is the code. It seems to work no
errors but a query show no new additions to the table.
$sql = "INSERT INTO employees
(first,last,address,date_of_birth,sex,age,telephone,
parent_guardian_name,parent_guardian_workplace,work_telephone,emergency_info
rmation_contact,
list_physical_conditions_if_any,all_schools_previously_attended,examinations
_passed,older_brothers,younger_brothers,older_sisters,younger_sisters,
names_sisters_or_brothers_attending_school) VALUES
('$first','$last','$address','$date_of_birth',$sex','$age','$telephone','$pa
rent_guardian_name','$parent_guardian_workplace',
'$work_telephone','$emergency_information_contact','$list_physical_condition
s_if_any','$all_schools_previously_attended','$examinations_passed','$older_
brothers','$younger_brothers','$older_sisters','$younger_sisters','$names_si
sters_or_brothers_attending_school')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
Neil
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002