in reply to Re: FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
in thread FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
Do you know for sure that will always be the case? It would seem easier to plan for it now and using an array than wait for a year, or five, only to realize that something changed in the design or usage of your code and now more rows are required. If it always returns one row, then looping over it with one row shouldn't cause any problems.
No, you're right, it shouldn't and it probably won't. I'm just trying to avoid unnecessary clutter by sticking things in a loop when actually just fetching a single value. And this thing has piqued my curiosity ;o)
Doing multiple executes on one prepared statement (as you wrote) works as expected. Also replacing the
print $test->fetchrow_array()with a
while($test->fetchrow_array()) { print; }works just fine (i.e. it allows the script to run completely) and prints exactly the same as before which leads me to believe that FreeTDS suspects there being more data to fetch.
Thanks for your input!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
by jdrago999 (Pilgrim) on May 26, 2010 at 19:10 UTC | |
by pvbcharon (Beadle) on May 27, 2010 at 07:18 UTC | |
|
Re^3: FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
by sierpinski (Chaplain) on May 26, 2010 at 17:08 UTC | |
by pvbcharon (Beadle) on May 27, 2010 at 07:19 UTC |