Can't Connect to Database via PHP
(trying to connect via tcp://127.0.0.1:3306) in C:...\database.php on line 10"
I'm following along with the PhP Programming videos and I've tried re installing Drupal Dev Desktop to accomplish exactly what's being done in the videos but I keep hitting this brick wall. I tried looking online for some help but perhaps I missed a step? My url and database are set up the same way as in the videos:
// Replace with the username and password you used for PhpMyAdmin.
$server = 'localhost';
$username = 'drupaluser';
$password = '';
$database = 'my_database';
So what's wrong?
* 6:03 - How to connect to a MySQL database with PHP
I'm encountering the same issue. I'm new to PHP and googled around and still haven't resolved this issue.
Hey folks,
If you run into this problem, it's possible that the version of PHP you're using has deprecated the mysql functions. Here's what one user said solved their problem:
"After looking through my php error log, I discovered the issue. Apparently the version of PHP I am using no longer accepts the mysql_connect function, but instead uses mysqli extension. Once I replaced all the relevant functions, I was able to connect to my database, no problem! Thanks for the quick response, regardless."
I hope that helps!
Chris
did you ever figure this out? I am having the same problem