From: Ard Biesheuvel Date: Sun, 15 Feb 2004 20:47:21 +0000 (+0000) Subject: CS/WS X-Git-Tag: php-4.3.5RC3~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=deb89ce2f418505b498256b8f5292e3e05476b47;p=php CS/WS --- diff --git a/ext/interbase/tests/002.phpt b/ext/interbase/tests/002.phpt index 6f30fb85fd..c6cfdf0872 100644 --- a/ext/interbase/tests/002.phpt +++ b/ext/interbase/tests/002.phpt @@ -7,21 +7,21 @@ InterBase: connect, close and pconnect --FILE-- --EXPECT-- --- test1 --- diff --git a/ext/interbase/tests/003.phpt b/ext/interbase/tests/003.phpt index 80685e54a0..c3cf2ca278 100644 --- a/ext/interbase/tests/003.phpt +++ b/ext/interbase/tests/003.phpt @@ -7,128 +7,130 @@ InterBase: misc sql types (may take a while) --FILE-- V_CHAR,0,strlen($v_char)) != $v_char){ - echo " CHAR fail:\n"; - echo " in: $v_char\n"; - echo " out: $row->V_CHAR\n"; - } - if($row->V_DATE != $v_date){ - echo " DATE fail\n"; - echo " in: $v_date\n"; - echo " out: $row->V_DATE\n"; - } - if($row->V_DECIMAL4_2 != $v_decimal4_2){ - echo " DECIMAL4_2 fail\n"; - echo " in: $v_decimal4_2\n"; - echo " out: $row->V_DECIMAL4_2\n"; - } - if($row->V_DECIMAL4_0 != $v_decimal4_0){ - echo " DECIMAL4_0 fail\n"; - echo " in: $v_decimal4_0\n"; - echo " out: $row->V_DECIMAL4_0\n"; - } - if($row->V_DECIMAL7_2 != $v_decimal7_2){ - echo " DECIMAL7_2 fail\n"; - echo " in: $v_decimal7_2\n"; - echo " out: $row->V_DECIMAL7_2\n"; - } - if($row->V_DECIMAL7_0 != $v_decimal7_0){ - echo " DECIMAL7_0 fail\n"; - echo " in: $v_decimal7_0\n"; - echo " out: $row->V_DECIMAL7_0\n"; - } - if($row->V_NUMERIC15_15 != $v_numeric15_15){ - echo " NUMERIC15_15 fail\n"; - echo " in: $v_numeric15_15\n"; - echo " out: $row->V_NUMERIC15_15\n"; - } - if($row->V_NUMERIC15_0 != (string)$v_numeric15_0){ - echo " NUMERIC15_0 fail\n"; - echo " in: $v_numeric15_0\n"; - echo " out: $row->V_NUMERIC15_0\n"; - } - - if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)){ - echo " DOUBLE fail\n"; - echo " in: $v_double\n"; - echo " out: $row->V_DOUBLE\n"; - } - if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)){ - echo " FLOAT fail\n"; - echo " in: $v_float\n"; - echo " out: $row->V_FLOAT\n"; - } - if($row->V_INTEGER != $v_integer){ - echo " INTEGER fail\n"; - echo " in: $v_integer\n"; - echo " out: $row->V_INTEGER\n"; - } - if($row->V_SMALLINT != $v_smallint){ - echo " SMALLINT fail\n"; - echo " in: $v_smallint\n"; - echo " out: $row->V_SMALLINT\n"; - } - - if(substr($row->V_VARCHAR,0,strlen($v_varchar)) != $v_varchar){ - echo " VARCHAR fail:\n"; - echo " in: $v_varchar\n"; - echo " out: $row->V_VARCHAR\n"; - } - - ibase_free_result($sel); - } /* for($iter) */ +/* if timefmt is not supported, suppress error here */ +@ibase_timefmt("%m/%d/%Y %H:%M:%S"); - ibase_close(); - echo "end of test\n"; +for ($iter = 0; $iter < 10; ++$iter) { + /* prepare data */ + $v_char = rand_str(1000); + $v_date = rand_datetime(); + $v_decimal4_2 = rand_number(4,2); + $v_decimal4_0 = rand_number(4,0); + $v_decimal7_2 = rand_number(7,2); + $v_decimal7_0 = rand_number(7,0); + $v_numeric15_15 = rand_number(15,15); + $v_numeric15_0 = $iter ? rand_number(15,0) : 0; + $v_double = rand_number(18); + $v_float = rand_number(7); + $v_integer = rand_number(9,0); + $v_smallint = rand_number(5) % 32767; + $v_varchar = rand_str(10000); + + ibase_query( + "INSERT INTO test3 (iter, v_char,v_date,v_decimal4_2, v_decimal4_0, v_decimal7_2, v_decimal7_0, + v_numeric15_15, v_numeric15_0,v_double,v_float,v_integer,v_smallint,v_varchar) + VALUES ($iter, '$v_char','$v_date',$v_decimal4_2, $v_decimal4_0, $v_decimal7_2, $v_decimal7_0, + $v_numeric15_15, $v_numeric15_0,$v_double,$v_float,$v_integer,$v_smallint,'$v_varchar')"); + + $sel = ibase_query('SELECT * FROM test3 WHERE iter = ?',$iter); + $row = ibase_fetch_object($sel); + if (substr($row->V_CHAR,0,strlen($v_char)) != $v_char) { + echo " CHAR fail:\n"; + echo " in: $v_char\n"; + echo " out: $row->V_CHAR\n"; + } + if ($row->V_DATE != $v_date) { + echo " DATE fail\n"; + echo " in: $v_date\n"; + echo " out: $row->V_DATE\n"; + } + if ($row->V_DECIMAL4_2 != $v_decimal4_2) { + echo " DECIMAL4_2 fail\n"; + echo " in: $v_decimal4_2\n"; + echo " out: $row->V_DECIMAL4_2\n"; + } + if ($row->V_DECIMAL4_0 != $v_decimal4_0) { + echo " DECIMAL4_0 fail\n"; + echo " in: $v_decimal4_0\n"; + echo " out: $row->V_DECIMAL4_0\n"; + } + if ($row->V_DECIMAL7_2 != $v_decimal7_2) { + echo " DECIMAL7_2 fail\n"; + echo " in: $v_decimal7_2\n"; + echo " out: $row->V_DECIMAL7_2\n"; + } + if ($row->V_DECIMAL7_0 != $v_decimal7_0) { + echo " DECIMAL7_0 fail\n"; + echo " in: $v_decimal7_0\n"; + echo " out: $row->V_DECIMAL7_0\n"; + } + if ($row->V_NUMERIC15_15 != $v_numeric15_15) { + echo " NUMERIC15_15 fail\n"; + echo " in: $v_numeric15_15\n"; + echo " out: $row->V_NUMERIC15_15\n"; + } + if ($row->V_NUMERIC15_0 != (string)$v_numeric15_0) { + echo " NUMERIC15_0 fail\n"; + echo " in: $v_numeric15_0\n"; + echo " out: $row->V_NUMERIC15_0\n"; + } + if (abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)) { + echo " DOUBLE fail\n"; + echo " in: $v_double\n"; + echo " out: $row->V_DOUBLE\n"; + } + if (abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)) { + echo " FLOAT fail\n"; + echo " in: $v_float\n"; + echo " out: $row->V_FLOAT\n"; + } + if ($row->V_INTEGER != $v_integer) { + echo " INTEGER fail\n"; + echo " in: $v_integer\n"; + echo " out: $row->V_INTEGER\n"; + } + if ($row->V_SMALLINT != $v_smallint) { + echo " SMALLINT fail\n"; + echo " in: $v_smallint\n"; + echo " out: $row->V_SMALLINT\n"; + } + if (substr($row->V_VARCHAR,0,strlen($v_varchar)) != $v_varchar) { + echo " VARCHAR fail:\n"; + echo " in: $v_varchar\n"; + echo " out: $row->V_VARCHAR\n"; + } + + ibase_free_result($sel); +} /* for($iter) */ + +ibase_close(); +echo "end of test\n"; ?> --EXPECT-- end of test diff --git a/ext/interbase/tests/004.phpt b/ext/interbase/tests/004.phpt index 85272b3a09..af241767ff 100644 --- a/ext/interbase/tests/004.phpt +++ b/ext/interbase/tests/004.phpt @@ -5,116 +5,118 @@ InterBase: BLOB test --POST-- --GET-- --FILE-- -V_BLOB); - - $blob = ''; - while($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) - $blob .= $piece; - if($blob != $blob_str) - echo " BLOB 1 fail (1)\n"; - ibase_blob_close($bl_h); - - $bl_h = ibase_blob_open($row->V_BLOB); - - $blob = ''; - while($piece = ibase_blob_get($bl_h, 100 * 1024)) - $blob .= $piece; - if($blob != $blob_str) - echo " BLOB 1 fail (2)\n"; - ibase_blob_close($bl_h); - ibase_free_result($q); - unset($blob); - - echo "create blob 2\n"; - - ibase_query("insert into test4 (v_integer, v_blob) values (2, ?)", $blob_str); - - echo "test blob 2\n"; - - $q = ibase_query("select v_blob from test4 where v_integer = 2"); - $row = ibase_fetch_object($q,IBASE_TEXT); - - if($row->V_BLOB != $blob_str) - echo " BLOB 2 fail\n"; - ibase_free_result($q); - unset($blob); - - - echo "create blob 3\n"; - - $bl_h = ibase_blob_create(); - - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| PHP HTML Embedded Scripting Language Version 3.0 |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| Copyright (c) 1997-2000 PHP Development Team (See Credits file) |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - ibase_blob_add($bl_h, "| This program is free software; you can redistribute it and/or modify |\n"); - ibase_blob_add($bl_h, "| it under the terms of one of the following licenses: |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| A) the GNU General Public License as published by the Free Software |\n"); - ibase_blob_add($bl_h, "| Foundation; either version 2 of the License, or (at your option) |\n"); - ibase_blob_add($bl_h, "| any later version. |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| B) the PHP License as published by the PHP Development Team and |\n"); - ibase_blob_add($bl_h, "| included in the distribution in the file: LICENSE |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| This program is distributed in the hope that it will be useful, |\n"); - ibase_blob_add($bl_h, "| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n"); - ibase_blob_add($bl_h, "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |\n"); - ibase_blob_add($bl_h, "| GNU General Public License for more details. |\n"); - ibase_blob_add($bl_h, "| |\n"); - ibase_blob_add($bl_h, "| You should have received a copy of both licenses referred to here. |\n"); - ibase_blob_add($bl_h, "| If you did not, or have any questions about PHP licensing, please |\n"); - ibase_blob_add($bl_h, "| contact core@php.net. |\n"); - ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); - $bl_s = ibase_blob_close($bl_h); - ibase_query("insert into test4 (v_integer, v_blob) values (3, ?)", $bl_s); - - echo "echo blob 3\n"; - - $q = ibase_query("select v_blob from test4 where v_integer = 3"); - $row = ibase_fetch_object($q); - ibase_blob_echo($row->V_BLOB); - ibase_free_result($q); - - echo "fetch blob 3\n"; - $q = ibase_query("select v_blob from test4 where v_integer = 3"); - $row = ibase_fetch_object($q,IBASE_TEXT); - echo $row->V_BLOB; - ibase_free_result($q); - - ibase_close(); - unlink($name); - echo "end of test\n"; +V_BLOB); + +$blob = ''; +while ($piece = ibase_blob_get($bl_h, 1 + rand() % 1024)) + $blob .= $piece; +if ($blob != $blob_str) + echo " BLOB 1 fail (1)\n"; +ibase_blob_close($bl_h); + +$bl_h = ibase_blob_open($row->V_BLOB); + +$blob = ''; +while ($piece = ibase_blob_get($bl_h, 100 * 1024)) + $blob .= $piece; +if ($blob != $blob_str) + echo " BLOB 1 fail (2)\n"; +ibase_blob_close($bl_h); +ibase_free_result($q); +unset($blob); + +echo "create blob 2\n"; + +ibase_query("INSERT INTO test4 (v_integer, v_blob) VALUES (2, ?)", $blob_str); + +echo "test blob 2\n"; + +$q = ibase_query("SELECT v_blob FROM test4 WHERE v_integer = 2"); +$row = ibase_fetch_object($q,IBASE_TEXT); + +if ($row->V_BLOB != $blob_str) + echo " BLOB 2 fail\n"; +ibase_free_result($q); +unset($blob); + +echo "create blob 3\n"; + +$bl_h = ibase_blob_create(); +ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); +ibase_blob_add($bl_h, "| PHP HTML Embedded Scripting Language Version 3.0 |\n"); +ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); +ibase_blob_add($bl_h, "| Copyright (c) 1997-2000 PHP Development Team (See Credits file) |\n"); +ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); +ibase_blob_add($bl_h, "| This program is free software; you can redistribute it and/or modify |\n"); +ibase_blob_add($bl_h, "| it under the terms of one of the following licenses: |\n"); +ibase_blob_add($bl_h, "| |\n"); +ibase_blob_add($bl_h, "| A) the GNU General Public License as published by the Free Software |\n"); +ibase_blob_add($bl_h, "| Foundation; either version 2 of the License, or (at your option) |\n"); +ibase_blob_add($bl_h, "| any later version. |\n"); +ibase_blob_add($bl_h, "| |\n"); +ibase_blob_add($bl_h, "| B) the PHP License as published by the PHP Development Team and |\n"); +ibase_blob_add($bl_h, "| included in the distribution in the file: LICENSE |\n"); +ibase_blob_add($bl_h, "| |\n"); +ibase_blob_add($bl_h, "| This program is distributed in the hope that it will be useful, |\n"); +ibase_blob_add($bl_h, "| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n"); +ibase_blob_add($bl_h, "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |\n"); +ibase_blob_add($bl_h, "| GNU General Public License for more details. |\n"); +ibase_blob_add($bl_h, "| |\n"); +ibase_blob_add($bl_h, "| You should have received a copy of both licenses referred to here. |\n"); +ibase_blob_add($bl_h, "| If you did not, or have any questions about PHP licensing, please |\n"); +ibase_blob_add($bl_h, "| contact core@php.net. |\n"); +ibase_blob_add($bl_h, "+----------------------------------------------------------------------+\n"); +$bl_s = ibase_blob_close($bl_h); +ibase_query("INSERT INTO test4 (v_integer, v_blob) VALUES (3, ?)", $bl_s); + +echo "echo blob 3\n"; + +$q = ibase_query("SELECT v_blob FROM test4 WHERE v_integer = 3"); +$row = ibase_fetch_object($q); +ibase_blob_echo($row->V_BLOB); +ibase_free_result($q); + +echo "fetch blob 3\n"; + +$q = ibase_query("SELECT v_blob FROM test4 WHERE v_integer = 3"); +$row = ibase_fetch_object($q,IBASE_TEXT); +echo $row->V_BLOB; +ibase_free_result($q); + +ibase_close(); +unlink($name); + +echo "end of test\n"; ?> --EXPECT-- import blob 1 diff --git a/ext/interbase/tests/005.phpt b/ext/interbase/tests/005.phpt index 988b7536ed..3b1de09e66 100644 --- a/ext/interbase/tests/005.phpt +++ b/ext/interbase/tests/005.phpt @@ -5,19 +5,19 @@ InterBase: transactions --POST-- --GET-- --FILE-- - --EXPECT-- default transaction: diff --git a/ext/interbase/tests/006.phpt b/ext/interbase/tests/006.phpt index fee046b86d..726f1755c0 100644 --- a/ext/interbase/tests/006.phpt +++ b/ext/interbase/tests/006.phpt @@ -5,200 +5,196 @@ InterBase: binding (may take a while) --POST-- --GET-- --FILE-- -V_CHAR,0,strlen($v_char)) != $v_char){ - echo " CHAR fail:\n"; - echo " in: $v_char\n"; - echo " out: $row->V_CHAR\n"; - } - if($row->V_DATE != $v_date){ - echo " DATE fail\n"; - echo " in: $v_date\n"; - echo " out: $row->V_DATE\n"; - } - if($row->V_DECIMAL != $v_decimal){ - echo " DECIMAL fail\n"; - echo " in: $v_decimal\n"; - echo " out: $row->V_DECIMAL\n"; - } - if(abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)){ - echo " DOUBLE fail\n"; - echo " in: $v_double\n"; - echo " out: $row->V_DOUBLE\n"; - } - if(abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)){ - echo " FLOAT fail\n"; - echo " in: $v_float\n"; - echo " out: $row->V_FLOAT\n"; - } - if($row->V_INTEGER != $v_integer){ - echo " INTEGER fail\n"; - echo " in: $v_integer\n"; - echo " out: $row->V_INTEGER\n"; - } - if ($row->V_NUMERIC != $v_numeric){ - echo " NUMERIC fail\n"; - echo " in: $v_numeric\n"; - echo " out: $row->V_NUMERIC\n"; - } - if ($row->V_SMALLINT != $v_smallint){ - echo " SMALLINT fail\n"; - echo " in: $v_smallint\n"; - echo " out: $row->V_SMALLINT\n"; - } - if ($row->V_VARCHAR != $v_varchar){ - echo " VARCHAR fail:\n"; - echo " in: $v_varchar\n"; - echo " out: $row->V_VARCHAR\n"; - } - ibase_free_result($sel); - }/* for($iter)*/ - - echo "select\n"; - for($iter = 0; $iter < 3; $iter++){ - /* prepare data */ - $v_char = rand_str(1000); - $v_date = rand_datetime(); - $v_decimal = rand_number(12,3); - $v_double = rand_number(20); - $v_float = rand_number(7); - $v_integer = rand_number(9,0); - $v_numeric = rand_number(4,2); - $v_smallint = rand_number(5) % 32767; - $v_varchar = rand_str(10000); - - /* clear table*/ - ibase_query("delete from test6"); - - /* make one record */ - ibase_query("insert into test6 - (iter, v_char,v_date,v_decimal, - v_integer,v_numeric,v_smallint,v_varchar) - values (666, '$v_char','$v_date',$v_decimal, $v_integer, - $v_numeric, $v_smallint, '$v_varchar')"); - - /* test all types */ - if(!($sel = ibase_query( - "select iter from test6 where v_char = ?", $v_char))) - echo "CHAR fail\n"; - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_date = ?", $v_date))) - echo "DATE fail\n"; - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_decimal = ?", $v_decimal))) - echo "DECIMAL fail\n"; - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_integer = ?", $v_integer))) - echo "INTEGER fail\n"; - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_numeric = ?", $v_numeric))) - echo "NUMERIC fail\n"; - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_smallint = ?", $v_smallint))) - echo "SMALLINT fail\n"; - ibase_free_result($sel); - if(!($sel = ibase_query( - "select iter from test6 where v_varchar = ?", $v_varchar))) - echo "VARCHAR fail\n"; - ibase_free_result($sel); - - }/*for iter*/ - - echo "prepare and exec insert\n"; - - /* prepare table */ - ibase_query("delete from test6"); - - /* prepare query */ - $query = ibase_prepare( - "insert into test6 (v_integer) values (?)"); - - for($i = 0; $i < 10; $i++) - ibase_execute($query, $i); - - out_table("test6"); - - ibase_free_query($query); - - - echo "prepare and exec select\n"; - - /* prepare query */ - $query = ibase_prepare("select * from test6 - where v_integer between ? and ?"); - - $low_border = 2; - $high_border = 6; - - $res = ibase_execute($query, $low_border, $high_border); - out_result($res, "test6"); - ibase_free_result($res); - - $low_border = 0; - $high_border = 4; - $res = ibase_execute($query, $low_border, $high_border); - out_result($res, "test6"); - ibase_free_result($res); - - $res = ibase_execute($query, "5", 7.5); - out_result($res, "test6"); - ibase_free_result($res); - - ibase_free_query($query); - - ibase_close(); - echo "end of test\n"; +V_CHAR,0,strlen($v_char)) != $v_char) { + echo " CHAR fail:\n"; + echo " in: $v_char\n"; + echo " out: $row->V_CHAR\n"; + } + if ($row->V_DATE != $v_date) { + echo " DATE fail\n"; + echo " in: $v_date\n"; + echo " out: $row->V_DATE\n"; + } + if ($row->V_DECIMAL != $v_decimal) { + echo " DECIMAL fail\n"; + echo " in: $v_decimal\n"; + echo " out: $row->V_DECIMAL\n"; + } + if (abs($row->V_DOUBLE - $v_double) > abs($v_double / 1E15)) { + echo " DOUBLE fail\n"; + echo " in: $v_double\n"; + echo " out: $row->V_DOUBLE\n"; + } + if (abs($row->V_FLOAT - $v_float) > abs($v_float / 1E7)) { + echo " FLOAT fail\n"; + echo " in: $v_float\n"; + echo " out: $row->V_FLOAT\n"; + } + if ($row->V_INTEGER != $v_integer) { + echo " INTEGER fail\n"; + echo " in: $v_integer\n"; + echo " out: $row->V_INTEGER\n"; + } + if ($row->V_NUMERIC != $v_numeric) { + echo " NUMERIC fail\n"; + echo " in: $v_numeric\n"; + echo " out: $row->V_NUMERIC\n"; + } + if ($row->V_SMALLINT != $v_smallint) { + echo " SMALLINT fail\n"; + echo " in: $v_smallint\n"; + echo " out: $row->V_SMALLINT\n"; + } + if ($row->V_VARCHAR != $v_varchar) { + echo " VARCHAR fail:\n"; + echo " in: $v_varchar\n"; + echo " out: $row->V_VARCHAR\n"; + } + ibase_free_result($sel); +} /* for($iter) */ + +echo "select\n"; +for ($iter = 0; $iter < 3; ++$iter) { + /* prepare data */ + $v_char = rand_str(1000); + $v_date = rand_datetime(); + $v_decimal = rand_number(12,3); + $v_double = rand_number(20); + $v_float = rand_number(7); + $v_integer = rand_number(9,0); + $v_numeric = rand_number(4,2); + $v_smallint = rand_number(5) % 32767; + $v_varchar = rand_str(10000); + + /* clear table*/ + ibase_query("DELETE FROM test6"); + + /* make one record */ + ibase_query("INSERT INTO test6 (iter, v_char,v_date,v_decimal,v_integer,v_numeric, + v_smallint,v_varchar) VALUES (666, '$v_char','$v_date',$v_decimal, $v_integer, + $v_numeric, $v_smallint, '$v_varchar')"); + + /* test all types */ + if (!($sel = ibase_query( + "SELECT iter FROM test6 WHERE v_char = ?", $v_char))) + echo "CHAR fail\n"; + ibase_free_result($sel); + if (!($sel = ibase_query( + "SELECT iter FROM test6 WHERE v_date = ?", $v_date))) + echo "DATE fail\n"; + ibase_free_result($sel); + if (!($sel = ibase_query( + "SELECT iter FROM test6 WHERE v_decimal = ?", $v_decimal))) + echo "DECIMAL fail\n"; + ibase_free_result($sel); + if (!($sel = ibase_query( + "SELECT iter FROM test6 WHERE v_integer = ?", $v_integer))) + echo "INTEGER fail\n"; + ibase_free_result($sel); + if (!($sel = ibase_query( + "SELECT iter FROM test6 WHERE v_numeric = ?", $v_numeric))) + echo "NUMERIC fail\n"; + ibase_free_result($sel); + if (!($sel = ibase_query( + "SELECT iter FROM test6 WHERE v_smallint = ?", $v_smallint))) + echo "SMALLINT fail\n"; + ibase_free_result($sel); + if (!($sel = ibase_query( + "SELECT iter FROM test6 WHERE v_varchar = ?", $v_varchar))) + echo "VARCHAR fail\n"; + ibase_free_result($sel); + +} /* for ($iter) */ + +echo "prepare and exec insert\n"; + +/* prepare table */ +ibase_query("DELETE FROM test6"); + +/* prepare query */ +$query = ibase_prepare( + "INSERT INTO test6 (v_integer) VALUES (?)"); + +for($i = 0; $i < 10; $i++) + ibase_execute($query, $i); + +out_table("test6"); + +ibase_free_query($query); + + +echo "prepare and exec select\n"; + +/* prepare query */ +$query = ibase_prepare("SELECT * FROM test6 WHERE v_integer BETWEEN ? AND ?"); + +$low_border = 2; +$high_border = 6; + +$res = ibase_execute($query, $low_border, $high_border); +out_result($res, "test6"); +ibase_free_result($res); + +$low_border = 0; +$high_border = 4; +$res = ibase_execute($query, $low_border, $high_border); +out_result($res, "test6"); +ibase_free_result($res); + +$res = ibase_execute($query, "5", 7.5); +out_result($res, "test6"); +ibase_free_result($res); + +ibase_free_query($query); + +ibase_close(); +echo "end of test\n"; ?> --EXPECT-- insert