Posted by Jerry Stuckle on 03/18/07 19:49
Mitesh wrote:
> 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.
>
If you change the port in the MySQL configuration, you should also
change it in your php configuration. That's what they're there for.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|