[thelist] Looping through an updte query in php

Chris Blessing webguy at mail.rit.edu
Tue Jan 22 15:39:56 CST 2002


Similar to the ASP Request object, you can loop through the PHP
$HTTP_GET_VARS and $HTTP_POST_VARS arrays to get the values you're looking
for (or if you're using PHP 4.1+ you can use the new superglobals $_GET and
$_POST).  If you're using < 4.1 you must have the track_vars config option
turned on in your php[3].ini file.  HTH!

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of john corry
> Sent: Tuesday, January 22, 2002 4:25 PM
> To: Rudy
> Cc: thelist; matt at mattwarden.com
> Subject: [thelist] Looping through an updte query in php
>
>
> http://216.157.37.183/edit_rates.php
>
> I have this form (generated by PHP from a MySQL DB) that allows a user to
> edit rates information for a number of vacation properties.
>
> For each record in my 'rates' table, there is one row in the form that
> contains 4 text inputs with the rates for that record.
>
> I need to write a script that will write each of the input
> field's contents
> to the DB. Obviously, I don't want to hard code the SQL to
> reflect each row
> (what happens when I add a property?) But I don't know how to get all the
> form inputs as an array and loop through them, constructing the proper SQL
> as I go <though I did just give myself a little hint...it will
> use an array
> loop>
>
> Any tips?
>
> ...speaking of tips
> <tip>
> http://www.artlung.com/lab/other/ws_ftp_password_decoder/
>
> Forgot an FTP password but have the password stored in a WS_FTP.ini file?
> This handy URL has a script which translates a WS_FTP password from it's
> encoded form back to text.
> </tip>
>
> John Corry
> Neon Cowboy Design
> http://www.neoncowboy.com
> t: 808.572.8494 m: 808.283.7063
> email: john at neoncowboy.com
> mobile: cellphone at neoncowboy.com
>
>
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list