samedi 21 novembre 2015

SQL Checkbox with multiple values

I need some help with a php/sql program, referring checkboxes. Currently I have this:

foreach($result as $row){
  $device_serialnum = $row['device_serialnum'];
  $device_manufacturer = $row['device_manufacturer'];
  $description = $row['description'];
  echo("<input type=\"checkbox\" name = \"device_serialnum[]\" value=\"$device_serialnum\"> $device_serialnum : $device_manufacturer : $description<br/>");
}   

Where the values of device_serialnum, device_manufacturer and description come from a sql query made previously.

What I had in mind was for each checkbox have two values (device_serialnum, device_manufacturer), because they are two primary keys I need to retain in order to complete the next query.

Is there a simple way to that following the scheme of my previous code?

Thanks in advance,

Regards

Blackfing




Aucun commentaire:

Enregistrer un commentaire