by williamconley » Thu Feb 21, 2013 6:24 pm
if you cannot connect, it is usually because the user does not have permission to connect from that location. of course, bad user or pass is also quite possible, but most support calls on this topic result in "127.0.0.1" vs "localhost" vs an actual IP address.
A good test is to attempt the same credentials using the command line:
mysql asterisk -u MYSQLUSERNAME -pPASSWORD
Note that there is no space between -p and PASSWORD in this implementation.
if this fails, then your user does not have permission to log in from localhost which is required for php to log in with the same method.
Another method is to call the vicidial dbconnect.php above (from DomeDan) which loads the database variable "$link" and then uses it to fire off a query. After that you will need to "do something" with the results. There are many sample of how to view the results in all the various vicidial ".php" files.
However, if you'd like I can post a "sample" derived from using DomeDan's solution. We do it all the time to piggyback existing Vicidial code to generate new functionality.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294