I am writing a PHP application that will operate on a MySQL database.  There
will be 4 types of forms (like catalog request, info request, etc.) calling
the code which writes the data to the database.

Since the variable names on the forms will equal the MySQL column names (as they
should), I am wondering if there is a way for me to create my SQL statements on
the fly so that only data passed is written.  Otherwise I'll have to create 8
types of SQL statements...INSERT (if the record, keyed by e-mail address,
doesn't exist), and UPDATE (if the record does exist) for all 4 forms.

For example, on my "add to mailing list" form, only the e-mail address is
collected.  I'd like the PHP to recognize that only the 'email' field is passed
and create the SQL statement that only writes the e-mail to the database.

Any ideas greatly appreciated!

Thanks,

Rory

 --  -----------
providing the finest in midget technology

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to