Posted by Mitesh on 03/18/07 14:19
Jerry Stuckle wrote:
> Mitesh wrote:
> > How can I programattically retrieve MySQL server's port value through
> > PHP?
> >
>
> Did you try
>
> ini_get('mysql.default_port');
>
> (or, if you have mysqli installed...)
>
> ini_get('mysqli.default_port');
>
Thanx Jerry for the reply:
This returns the default port value. But when the MySQL server is
installed the app that runs after the installation lets the user
configure the MySQL port. Now I need to access this port value through
the PHP. My PHP script only works for the port value that is pre-
defined. So when the user again does configuration and changes the
port value, my PHP script (which calls my sql functions) no longer
works.
I think I have no alternative than to open the MySQL ini file through
PHP and search for the "port" text and retrieve it's value.
Navigation:
[Reply to this message]
|