Thanks for the help, all! Here was the problem...I think, I'm pretty sure,
eh?
In mysql_select_db($database_mydb, $mydb), I have the variable,
"$database_mydb", which is actually something that Macromedia's Dreamweaver
MX created (for those that don't know it, Dreamweaver MX supports a little
PHP).
Well, not to put the blame on Macromedia, it was all my fault and I now feel
a bit stupid, I think it all boiled down to "$database_mydb" not being
declared global in the function I wrote to do the query.
Funny that it worked probably 95% of the time. Must have been due to
mysql_pconnect or something holding open previous connections to the db and
the script just connecting to the last connected db. Anyway...
Sorry for the trouble!
Jeff
> -Original Message-
> From: hugh danaher [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 06, 2002 5:37 PM
> To: [EMAIL PROTECTED]
> Cc: php
> Subject: Re: [PHP] Weird intermittent "No Database Selected" problem
>
>
> Are all the variables needed for the function getting into your
> call_user_func()? Also, perhaps some aren't set or are being
> unset outside
> your function--say, you are opening a new page and not passing all the
> variables to it. The function (which apparently works) isn't getting set
> variables. Try echoing the input variables just above the
> function call and
> see if they're all there.
> Hope this helps,
> Hugh
>
> - Original Message -
> From: "Jeff Field" <[EMAIL PROTECTED]>
> To: "Php-General (E-mail)" <[EMAIL PROTECTED]>
> Sent: Thursday, June 06, 2002 2:34 PM
> Subject: RE: [PHP] Weird intermittent "No Database Selected" problem
>
>
> > Hmmm...not sure how to check the status of the db function calls (sorry,
> I'm
> > relatively new to PHP, help on this is appreciated), but I did add the
> > following to the script:
> >
> > echo "Error " . mysql_errno ( ). ": " . mysql_error ( );
> >
> > It prints out "Error 0:" when the script runs just fine, but
> nothing when
> > the page comes back with "No Database Selected".
> >
> > Any thoughts? Thanks!
> >
> > Jeff
> >
> > > -Original Message-
> > > From: Scott Hurring [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, June 06, 2002 4:15 PM
> > > To: Php-General (E-mail)
> > > Subject: RE: [PHP] Weird intermittent "No Database Selected" problem
> > >
> > >
> > > I assume you're not checking the status returned by the
> > > database function calls, becuase they'd probably give
> > > you valueable information on *why* it's doing that. :)
> > >
> > > try checking the return val, and (if using mysql) print
> > > out mysql_error() if you get a bad return val.
> > >
> > > ---
> > > Scott Hurring
> > > Systems Programmer
> > > EAC Corporation
> > > [EMAIL PROTECTED]
> > > Voice: 201-462-2149
> > > Fax: 201-288-1515
> > >
> > > > -Original Message-
> > > > From: Jeff Field [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, June 06, 2002 4:58 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP] Weird intermittent "No Database Selected" problem
> > > >
> > > >
> > > > I apologize...I just posted this to the database list but
> > > > then realized it
> > > > may not be a database issue, so thought I'd better give it a
> > > > shot over here.
> > > >
> > > > Help!
> > > >
> > > > I've been having a weird problem today (and maybe it's been
> > > > there all along,
> > > > just haven't noticed...it's only been live a few days). I
> > > > have a web page
> > > > that allows users to query my database by either subject or
> > > > alphabet (A-Z).
> > > > Today (and I think I noticed it once before but didn't pay
> > > > much attention),
> > > > if you do a query, the first time it comes back with the
> results. The
> > > > second time, clicking the same letter (or sometimes other
> > > > letters), for
> > > > instance, it comes back with a "Database Not Selected" error.
> > > > Or, every
> > > > time in a row for a dozen times it comes back with a
> > > > "Database Not Selected"
> > > > error. Or, sometimes it comes back with the results