hello everyone,

i need your opinions about this error that ive been receiving..
what could be the possible reason for PHP to produce this kind of error???

although i do have an answer to this but im not yet sure..so i i would like to ask for your
opinions..

Warning: pg_exec(): Query failed: ERROR: invalid input syntax for integer "a" in...

thank you very much..

    Pretty tough to debug without seeing the code. Sort of looks like you have a string value in your query where you want an integer value.

      $sql = "insert into deta(DetOrderID,DetTenno,DetTag,DetItemID,DetItemName,DetArai,DetQuick,DetSim,";
      $sql.= "DetAprice,DetTanka,DetDis,DetFinish,DetDiv,DetRes,DetDeli,DetOrderday,Detarea,DetSoz,DetSoz2,DetKak,DetKak2,DetSNo,DetSno2,DetKNo,DetKno2,Dkubun,DetCat)";

      		$sql.= " values ('$orderid','$Ctenno','$dettag[$i]','$detcode[$i]','$detname[$i]','$detarai[$i]',";
      		$sql.= "'$detqui[$i]','$detsim[$i]','$detaprice[$i]','$tanka','$disc','0','$detdiv[$i]',";
      		 $sql.= "'$detres[$i]','0','$detoday','$detarea','$sozainame','$sozainame2','$kakouname','$kakouname2',$detsoz[$i],$detsoz2[$i],$detkak[$i],$detkak2[$i],'0','$detcat[$i]')";
      
      
      
      
      	$res = pg_Exec($cond,$sql);

        I would suggest that for debugging you check if the query failed, and if so echo out $sql (or write it to an error log file) to see if all the variables in the values() section of the query have the expected values. If not, then back-track through the code to find out why not.

          Write a Reply...