Re: odbc_**** failing?

From: Date: Thu, 04 Jul 2002 21:04:22 +0000
Subject: Re: odbc_**** failing?
Groups: php.general 
Request: Send a blank email to php-general+get-105511@lists.php.net to get a copy of this message
>List, > The following code is erroring for me and I can't figure out why > >$db = odbc_connect("something", "something", "passwd"); ... or error_log("Could not connect to database."); >printf("%s", $db); // Prints ID 1 printf is a cannon pointed at a fly here... >// Hangs here it looks like >$rs = odbc_exec($db, "spGetItems"); ... or error_log(odbc_error()); # I don't know that odbc_error is the proper function name... php.net >// Never gets here >while(odbc_fetch_row($rs)) { > printf("%s", odbc_result($rs, 2)); >} Again, over-kill with the printf... Are you 100% sure 'spGetItems' will always return rows? If not, then you need to code for the possibility that there *ARE* no rows in 'spGetItems' (whatever that is). -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#105511) next »