PHP/mySQL Help
Hello-
I wrote a script in PHP that takes information from a form, and enters it into a database. However, the script only actually writes to the mySQL database periodically... it's not consistant. Can anyone give me an idea of what I might be doing wrong?
Thank you,
Casey
Casey Hansen
CaseyNet Online Design
http://www.caseynet.com
Mark Hensler posted this at 23:03 — 4th September 2000.
He has: 4,048 posts
Joined: Aug 2000
I don't get it.. the script will write to the database without being 'asked to'?
Can you post the script (minus the password stuff)? or is it too big?
Mark Hensler
If there is no answer on Google, then there is no question.
Maverick posted this at 17:36 — 5th September 2000.
They have: 334 posts
Joined: Dec 1999
I'm not sure I understand. Are you saying that sometimes when the form is processed it enters the info into the database and sometime it doesn't? If that's the case, there are a couple of things to check.
1) Make sure it's getting fed valid data. It could be choking on getting text fed into an int() field like if you have an input for Age: set as int(3), and somebody is trying to enter: sixteen in the form.
2) Are the inserts conditional? Like if $foo == 1 {
insert into etc etc etc} In that case, the state of $foo could be the culprit, so make sure it's set properly.
3) Check for unique fields. If you have a date or name field set as UNIQUE the data won't get entered if there's already an entry from that name or date.
4) Are NULL fields allowed? If you have something set as NOT NULL and that input is left blank on the form, the insert will fail.
It would help if you included your FORM code, the db table set-up and the INSERT statement here
[Edited by Maverick on 09-06-2000 at 02:03 PM]
123finder.com posted this at 20:54 — 8th September 2000.
They have: 60 posts
Joined: Aug 2000
Yes, you should always check all input before submit/change/edit the data
minor question: How could we determine that ALL the possibilities have been taken into account? Or wait until the user discover them (and may even hack the system down!)
http://new.123finder.com/ - Helps you find cool domains for FREE & Registers it for only $14.95/yr
http://www.ad-rotator.com/ - Free ad rotating system for small websites - Stop Ctrl-P/Ctrl-C the ad code!
------
Son
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.