Subject RE: [firebird-php] echo resultin sql
Author Nigel Weeks
> i want to echo the insert statement not just the values
> because i am getting a numeric overflow error on one csvline
> and the csvfiles are thousounds of lines. I can understand
> that it gets a resource id in fact i am fine with that and
> will have just echo the values but the bottom piece of code
> isnt it $rec that contains the pointer? and not $obj on the
> first line when i use the below method i get supplied
> argument is not a valid InterBase result resource?

The variable you fill with the 'ibase_prepare' contains nothing you can
read.
If want to know the exact values that killed the query, set an error flag
when the ibase_execute dies, and manufacture the string you're using...

<?php
...
$err = 0;
$prep = ibase_prep("insert into table(field) VALUES (?)");
for($a = 0; $a<10; $a++){
$rec = ibase_execute($prep,$a) or $err = 1;
if($err == 1){
echo "The Query that died was: 'insert into table(field) values
(".$a.")'";
}
}
...
?>