Perhaps this example may help. Eg: a form with checkboxes and submit button, a few are checked and I want to delete the corresponding records from the database. The database table has an ID column:

for each ($argv as $key=>$value) {
   //$key is named cb_1 $value is "checked"
   //to get 1 from the key name, then
   //needed: function like nameof()
   $var=nameof($key);
   $ID=substr($var,3);
   $query="delete * from dbtable where ID='$ID'";
   //etc
}




For database use I do the following in forms:

name="data[field_name]"

Or for multiple table that you update together:

name="data[table_name][field_name]"

-Shawn




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to