Insertion is a pain, any ideas?
Posted: Fri Mar 21, 2003 8:36 am
Working on storing information that is choosen via checkbox, tested with print_r() and information is parsing thru, but will not insert into table. Any ideas?
Code: Select all
if(isset($_POSTї"std_sw"]) ): // check to see if any checkboxes selected
$std_sw = $_POSTї"std_sw"]; // get the array of selected values
$cnt = count($std_sw); // count the number of selected items
//Insert into cpu_sw_linking table
for( $i = 0; $i < $cnt; $i++):
$cpu_sw_link_insert = "INSERT INTO cpu_software_link (cpu_id,sw_id) VALUES ("$_POSTїcpu_id]","$std_swї$i]")";
$cpu_sw_link_insert_result = mysql_query($cpu_sw_link_insert) or die ("Could not insert into cpu_sw_link");
endfor;
endif;