note 106963 added to function.odbc-fetch-array

From: Date: Wed, 21 Dec 2011 12:09:02 +0000
Subject: note 106963 added to function.odbc-fetch-array
Groups: php.notes 
Request: Send a blank email to php-notes+get-185193@lists.php.net to get a copy of this message
I waslooking for funcion which can select row(s) from MSSQL via ODBC using Stored procedure. this is example: single row: <?php $dbh=odbc_connect($DBhost, $DBuser, $DBpass ) or die ("error in db connect"); $par1='USA'; $PROC="EXEC list_country '".$par1."' "; // run stored procedure which select country with column name=USA $rs=odbc_exec($dbh,$PROC); $row=odbc_fetch_array($rs); odbc_free_result($rs); else $row=false; return $row; print_r($row); //you will see whole selected row ?> ------------------------------------------- multiple row: <?php $dbh=odbc_connect($DBhost, $DBuser, $DBpass ) or die ("error in db connect"); $PROC="EXEC list_country_all"; // run stored procedure which select all countries (rows) $rs=odbc_exec($dbh,$PROC); $i=0; while ($row=odbc_fetch_array($rs)) { $vys[$i]=$row; $i++; } return $vys; print_r($vys); //you will see selected rows ?> ---- Server IP: 69.147.83.197 Probable Submitter: 62.168.10.12 ---- Manual Page -- http://www.php.net/manual/en/function.odbc-fetch-array.php Edit -- https://master.php.net/note/edit/106963 Del: integrated -- https://master.php.net/note/delete/106963/integrated Del: useless -- https://master.php.net/note/delete/106963/useless Del: bad code -- https://master.php.net/note/delete/106963/bad+code Del: spam -- https://master.php.net/note/delete/106963/spam Del: non-english -- https://master.php.net/note/delete/106963/non-english Del: in docs -- https://master.php.net/note/delete/106963/in+docs Del: other reasons-- https://master.php.net/note/delete/106963 Reject -- https://master.php.net/note/reject/106963 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185193) next »