Page 1 of 1

Insertion is a pain, any ideas?

Posted: Fri Mar 21, 2003 8:36 am
by DynPHP
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&#1111;cpu_id]","$std_sw&#1111;$i]")";
$cpu_sw_link_insert_result = mysql_query($cpu_sw_link_insert) or die ("Could not insert into cpu_sw_link");
endfor; 

endif;

Posted: Fri Mar 21, 2003 9:25 am
by volka
try

Code: Select all

$cpu_sw_link_insert_result = mysql_query($cpu_sw_link_insert) or die ($cpu_sw_link_insert . ': '. mysql_error());