> -----Original Message-----
> From: Chris [mailto:dmag...@gmail.com]
> Sent: Thursday, February 26, 2009 4:16 PM
> To: Boyd, Todd M.
> Cc: PJ; PHP General list
> Subject: Re: [PHP] Re: catch the error
> > In examples sent to you, people foolishly replaced your $db var with
> > $db_connect ONLY FOR PART OF THE SCRIPT. You've defined your
> > connection as $db_connect in some versions of the source, but then
> > reference $db (without _connect) in your mysql_select call in that
> > source.
> > $db = mysql_connect([option list here]); # <-- this code
> > connection
> > mysql_select_db([some name], $db); # notice how $db is here?
> > $result = mysql_query([some query], $db); # it's here, too!
> > $db becomes your resource link when you use mysql_connect. That
> > link must then be passed to your mysql functions. Otherwise, they
> > no idea which database connection you are attempting to use.
> If no connection is specified, the last one is used.
> It is an optional argument (only *really* needed when you have
> connections in the same script).
RTF E-mail I sent?
He had used $db_connect instead of $db. $db_connect hadn't been set to
anything. He was specifying a connection, but it was null. Unless it
falls back to the last connection used in the case of an empty variable,
then this was most likely (read: proven to be) the problem.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php