php - Update statement not executing inside while loop -


please me this.

i have php code search first records needed inserted table

here code:

//search split values (capacitors) $capacitance =mysql_query("select itemno, wwpn,  substr(val, 1, length(val) / 2) capacitor,                            substr(val, length(val) / 2+1) capasitance                              bom_csv boardnumber ='$board' , bom_csv.qty<>'' , bom_csv.qty !='qty';"); while($row =mysql_fetch_array($capacitance))  {     echo "<pre>";     echo $row['itemno'];     echo $row['capacitor'];     echo $row['capasitance'];     echo $row['wwpn'];     echo "</pre>";     $capacitor = $row['capacitor'];     $capacity =$row['capasitance'];     $adi_pn=$row['adi_pn'];     $itemno=$row['itemno'];      //insert via update     $update =@mysql_query ("update bom_crunching set capacitor ='$capacitor', capacitance ='$capacity' boardmodel ='$board' , adi_pn ='$adi_pn'");     if ($update)     {         echo "okay!";     }     else     {         echo "not okay!";     }  } 

while executing it, not getting errors. however, when @ query browser doesn't have data inserted. result want insert records in table via update statement because has default value of null.

thanks in advance!

first step, change line:

 $update =@mysql_query ("update bom_crunching set capacitor ='$capacitor', capacitance ='$capacity' boardmodel ='$board' , adi_pn ='$adi_pn'"); 

to:

 $update =mysql_query ("update bom_crunching set capacitor ='$capacitor', capacitance ='$capacity' boardmodel ='$board' , adi_pn ='$adi_pn'") or die( mysql_error() ); 

so informed problem, can better.

;)


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -