note 106963 deleted from function.odbc-fetch-array by tularis

From: Date: Thu, 22 Dec 2011 20:43:52 +0000
Subject: note 106963 deleted from function.odbc-fetch-array by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-185222@lists.php.net to get a copy of this message
Note Submitter: zamecnik dot ivan at gmail dot com Reason: useless ---- 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 ?>

« previous php.notes (#185222) next »