You can. However, in these situations (in other languages) I've written code
generators that generate either the entire HTML/PHP page for me or at the
very least, the data object that I am talking to, complete with
SELECT/INSERT/UPDATE and DELETE statements.

That having been said, not trying to be a smart a** but if your table is 500
columns wide, you might revisit your design, if that's possible.  it could
be that you could normalize it more and reduce the number of columns you are
working with. (or not, that may not be an option)

My $.02 worth,
Cal
*
* Cal Evans
* Senior Internet Dreamer
* http://www.calevans.com
*
----- Original Message -----
From: "WeAreUs" <[EMAIL PROTECTED]>
To: "MySQL" <[EMAIL PROTECTED]>
Sent: Monday, June 18, 2001 3:27 PM
Subject: seeking clever php / mySql generic method


> Hi All!
>
> While this is not a huge problem, it is a recurring one so I thought I
would
> see if someone else has a nice generic way of handling this situation.   I
> often set up database tables with a PHP4 interface to handle insertions.
> It is always set up on a CGI basis, wherein a form blasts variable names
and
> values to the interface, which does the insert.  Often a table consists of
a
> few hundred variables.   Clearly when entering the variables by name into
> the statements below, there is room for little errors to creep in, even
> though I copy the var names from a table export.    For example, in a list
> of 500 variable names I might accidentally not copy a variable or miss
part
> of one inadvertantly.   This takes a while to find.
>
> $Entry=MYSQL_QUERY("INSERT INTO seniors(interviewer, surveynum, dat, q1_1,
> q1_2, q1_3, q1_4)
>                VALUES('$interviewer', '$surveynum', '$dat', '$q1_1',
> '$q1_2', '$q1_3', '$q1_4')");
>
> Being a klutz, I frequently make assorted little errors and it takes some
> time to figure where I have screwed up each and every time I set up one of
> these things.
>
> I'm wondering therefore if there is a Better Way than using the exact
> variable names.  For example, using something like a while statement
> including :
> while(list($key, $val) = each($HTTP_GET_VARS)) {  clever stuff here }
Does
> anyone have ideas on how to do this better?  I don't think that I am being
> efficient. . .
>
> Thanks!
>
> -Warren
>
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to