|
From: Chris C. <cc...@fi...> - 2013-01-22 13:57:42
|
I have limited experience with PHP, but maybe I can muddle through...
On 22/01/13 05:54 AM, Mike Prudence wrote:
> if (odbc_fetch_row($result))
> $retval = odbc_result($result, 'Name');
> else
> $retval = "Unknown";
What if there are more rows?
You should more likely do something like:
if (odbc_fetch_row($result, 0))
$retval = odbc_result($result, 'Name');
else
$retval = "Unknown";
while(odbc_fetch_row($result)) {
// do something with the extra results (or not)
}
Or maybe you could call odbc_free_result before odbc_commit and odbc_close.
--
Chris Craig
Software Developer
Fibernetics Corp
605 Boxwood Dr
Cambridge ON N3E 1A5
519-489-6700 x 753
|