|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I have a query selecting all column names of a table. A form is then created from this.
This step works correctly. When the form is submitted, however, I cannot get the script to read in the values sent by the user which then match to the column name with which it should insert against. I have been, at various times , able to write the columnnames (prefixed with a dollar sign) back into the database, but not the values submitted by the form. I have included the meat of it in a txt. Any help is much appreciated. |
|
#2
|
||||
|
||||
|
Why not just do something like the following:
PHP Code:
I don't see any real advantage to validating your column list against what's actually in the database: Since you're forcing the column list anyway, if anybody screws with the field names and provides invalid columns, the query'll bomb anyway. And it appears that your field names are going to match column names in any case, so you might as well make the task easy on yourself. |
|
#3
|
|||
|
|||
|
Thanks
aah...I'll put it down to minimal array function knowledge (to start with).
Otherwise, thanks for your time - this will definitely save much of mine... |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Problem reiterating column_names for use in subsequent insert query. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|