Re: MySQL Client/Server PHP problem
| From: | Hardy Merrill | Date: | Thu, 28 Dec 2000 17:46:50 +0000 |
| Subject: | Re: MySQL Client/Server PHP problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32113@lists.php.net to get a copy of this message | ||
Ok, I can change those constants to variables, but just so I
understand, what do I need to do to get the new "host_b" value
of constant DB_SERVER recognized by PHP? PHP is compiled into Apache,
so I tried bringing Apache down and up on the client system where
the PHP script is running, but still "host_a"(actually the old value
is "localhost" instead of "host_a") keeps appearing.
Please help.
Thanks.
--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com
Mukul Sabharwal [mukulsabharwal@yahoo.com] wrote:
> Well that's because define() declares a constant and
> hence the value can't be changed, you should put it
> into a variable.
>
> --- Hardy Merrill <merrill@missioncriticallinux.com>
> wrote: > mysql 3.23.28 gamma
> > PHP 4.0b4pl1
> > Apache 1.3.12
> >
> > I have a PHP script that "include"s
> > 1. a file that defines MySQL database constants,
> > one of which
> > is the HOST that the MySQL database is on, and
> > 2. a file that contains a MySQL connection
> > function.
> >
> > The main script "include"s both of these. In the
> > database
> > constants "include" file, after changing the
> > DB_SERVER constant
> >
> > From: define("DB_SERVER","host_a");
> >
> > To: define("DB_SERVER","host_b");
> >
> >
> > The "include"ed connection function still gets
> > "host_a" as
> > the value of the DB_SERVER constant. I can connect
> > at the
> > command line using "mysql" to "host_b" with no
> > problem, and I can
> > get my PHP script to connect to "host_b" if I
> > hardcode
> > host_b in the connect.
> >
> > I've tried bringing MySQL up on the client
> > system(where the
> > script runs) and issuing the "mysqladmin
> > flush-hosts" command,
> > which seems to work(comes back to the prompt), but
> > every time
> > DB_SERVER gets the value "host_a".
> >
> > Any ideas?
> >
> > TIA.
> >
> > --
> > Hardy Merrill
> > Mission Critical Linux, Inc.
> > http://www.missioncriticallinux.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail:
> > php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail:
> > php-general-help@lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> >
>
>
> =====
> To Find Out More About Me : http://mukul.tsx.org/
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/