note 90595 modified in function.odbc-execute by danbrown

From: Date: Wed, 29 Apr 2009 19:03:21 +0000
Subject: note 90595 modified in function.odbc-execute by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-154019@lists.php.net to get a copy of this message
if you can't use php_mssql module in your environment (suse linux, apache2, php5, FreeTDS, unixODBC) an alternative is to use sql server functions instead of procedures. here is my sample code. <?php $connect = odbc_connect($myDB, $myUser, $myPass); $query = "SELECT dbo.<function>(<column>,<text>) alias"; // perform the query $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)) { $Var1 = odbc_result($result, <column alias>); //echo "Var1: " . $Var1 . "<br>"; // add additional logic } ?> Once I figured this out, my app worked perfectly. --was-- if you can't use php_mssql module in your environment (suse linux, apache2, php5, FreeTDS, unixODBC) an alternative is to use sql server functions instead of procedures. here is my sample code. $connect = odbc_connect($myDB, $myUser, $myPass); $query = "SELECT dbo.<function>(<column>,<text>) alias"; // perform the query $result = odbc_exec($connect, $query); while(odbc_fetch_row($result)) { $Var1 = odbc_result($result, <column alias>); //echo "Var1: " . $Var1 . "<br>"; // add additional logic } Once I figured this out, my app worked perfectly. http://php.net/manual/en/function.odbc-execute.php

« previous php.notes (#154019) next »