Date: 04/30/00
- Next message: Toshihide Tony Nakamura: "[PHP3] myadmin & similar"
- Previous message: Rossi Designs: "[PHP3] homesite plugin?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Okay. I've looked high and low but can't seem to find anything relative.
I am writing a custom script, but am trying to do so with duplication in
mind.
The issue I am having is this:
For each client, they have unique fields in a table.
I can define the db name, table name, etc in a config.inc file, but the
problem comes to the fields in the tables.
I want to create the add string, modify string by querying the database.
Instead of
$add_string = "$auth_no, "
."$did_no, "
."$acct_no, "
."$c_name, "
."$f_name, "
."$l_name, "
."$uname, "
."$pwd "
.")" ;
Can't I somehow query the database with a loop? Something like this:
$add_string = "" ;
for ( $c = 0; $c < $num_fields; $c++) {
$add_string .= mysql_fieldname($result, $c ) ;
} // end of for-loop
Of course I'd have to make sure the last field wouldn't have a comma after
it and all, but it's just the above I can't figure.
The real problem comes with the modify part when you have to go 'UPDATE
$tbname SET (field=$field, field2=$field2 etc)
Can a loop be made for this?
The trouble is having the $mod_string look like the above.
How do you do: mysql_fieldname($result, $c ) = $ mysql_fieldname($result,
$c ) ??? and get it to actually look like above without it passing
variables not set from the form that you want the variables to be?
I hope I'm being clear enough.
Thank you,
Derek Bruce
dbruce <email protected>
www.browsehere.com
v. 603.880.8117
-- PHP 3 Mailing List <http://www.php.net/> To unsubscribe, send an empty message to php3-unsubscribe <email protected> To subscribe to the digest, e-mail: php3-digest-subscribe <email protected> To search the mailing list archive, go to: http://www.php.net/mailsearch.php3 To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Toshihide Tony Nakamura: "[PHP3] myadmin & similar"
- Previous message: Rossi Designs: "[PHP3] homesite plugin?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

