Page 1 of 1

form validation then update sql

Posted: Mon Jan 19, 2004 5:30 pm
by AXEmonster
hi guys
can some one give me an idea how to do the following

three form fields.

if 1 or 2 of the form fields have a value use this sql update statment

if all 3 have a value use this sql update statment

------------

would i be right in collecting form content into an array and counting array

**using mysql as backend**

Posted: Mon Jan 19, 2004 6:11 pm
by pickle
Luckily, the form content is already in an array - either $_POST or $_GET. Just counting that array would be the easiest way I can think of. The only difficulty I can think of is that if the form variables are used in the query, you may not be certain which ones are filled in. You're still going to have to do checks against specific form values.