Re: The ability of accessing DB
| From: | Paul Burney | Date: | Mon, 30 Dec 2002 18:16:02 +0000 |
| Subject: | Re: The ability of accessing DB | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24464@lists.php.net to get a copy of this message | ||
on 12/30/02 9:51 AM, midheart at midheart@eis01.ee.ccu.edu.tw appended the
following bits to my mbox:
> Well, I didn't define my question well last time.
> My question is that when I try to reload a php page, I would sometimes get a
> warning mesg, Warning: 1 is not a Sybase result index ...., or I would be
> lucky to get the correct output. Even if the first time to open the php
> page, it would be warning mesgs everywhere.
>
> My database is Sybase, and I think that my php coding wouln't get wrong!
> Because I could get the correct output, just after some reloading the page.
>
> Does anybody have any experience as this one?
> HOW do you solve it?
> Maybe I forget to initialize something, or to clean something. Anyone knows?
I've seen something a bit similar using MySQL. I was using persistent
connections to a database in several scripts. In one of the scripts, I
hadn't performed the database selection command (MySQL_select_db). That
page would work *if* it was served by the web server process that already
had a connection to the database with the correct DB selected, but would pop
up "warning... Not a result..." if not. Adding the select database command
in the script solved it, of course.
Check phpinfo() to see if sybase persistent connections are allowed, and if
you aren't using the default database, make sure you are calling the
sybase_select_db() command before the queries.
http://www.php.net/manual/en/function.sybase-select-db.php
HTH.
Sincerely,
Paul Burney
<http://paulburney.com/>
<?php
while ($self != "asleep") {
$sheep_count++;
}
?>