Skip to Content.
Sympa Menu

freetds - Re: [freetds] no-PHP

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT t-online.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] no-PHP
  • Date: Thu, 27 Jul 2006 21:28:31 +0200


On Jul 27, 2006, at 17:53, Rich Young wrote:

$connect = odbc_connect("MSSQLTest", "test_user", "passX") or
$result = odbc_exec($connect, $query);
$temp = mssql_num_rows($result) ;
Okay, I don't see anything obviously wrong here except that I'm not sure
if it is OK to use mssql_num_rows($result) when $result was initialized
with odbc_exec.

No, actually, that is very obviously wrong.
You absolutely can't mix mssql and odbc functions.

Choose whether you're going through the mssql extension (php mssql ext -> FreeTDS dblib driver) or the odbc extension (php odbc ext -> unixODBC/iODBC driver manager -> FreeTDS odbc driver) and stick with it.
If you really want to, you can use both even in a single script, however, you must initialize the connection with both then.

--
fds




Archive powered by MHonArc 2.6.24.

Top of Page