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!
In reply to Re^2: FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
by pvbcharon
in thread FreeTDS (Linux) vs. SQLSRV32.dll (Windows) via ODBC
by pvbcharon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |