You are here: Re: Retrieving MySQL server's port value with PHP « PHP Programming Language « IT news, forums, messages
Re: Retrieving MySQL server's port value with PHP

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация