-1

I'm a newbie at PHP, and coding in general, however I'm attempting to set up a simple user login/registration page using a MySQL database via phpmyadmin. After hours of trawling through forums etc, I could only find outdated information with no relevance to my specific issue.

My set up is as follows:

XAMPP v3.2.2, phpMyAdmin (Apache/2.4.18 (Win32) Open SSL/1.0.2e, PHP/7.0.3 with mysqli PHP extension/ Maria DB Server Type) & Dreamweaver CC.

I have set up a new site & a new server (following various online tutorials that show the same method) but when I attempt to define a connection via recordset, it displays the error message:

"Your PHP server doesn't have the MySQL module loaded or you can't use the mysql_(p)connect functions."

I have the MySQL module loaded and it's working fine as I am able to connect to phpmyadmin. Apache module is loaded and it's working fine as I am able to connect to my localhost in the web browser. Details for testing server have been set up in C:\xampp\htdocs\mysite and changed to PHP/MySQL server model. The database and tables have been created in phpmyadmin and ready to go, however I just can't connect to them through Dreamweaver CC.

I've tried changing information in config.inc.php, tried changing extension_dir path to mysqli.dll in php.ini (which is in C:\xampp\php\ext) and also uninstalled and reinstalled XAMPP twice.

I believe that my phpmyadmin and XAMPP server are working fine, however I just can't seem to have any success linking it to my php pages in Dreamweaver CC.

Am I missing anything obvious? Any help/clarity would be greatly appreciated as I'm currently losing all hope! Thank you!

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
A Bray
  • 1
  • 1
  • 1
  • 2

3 Answers3

1

i know this is a little old but i was able to fix the problem. xampp by default only has MySQLi dll activated. go to the php ini file and uncomment the MySQL dll and restart the Apache server. this worked for me. also cs6 need the database extension installed.

0

The error says "Your PHP server doesn't have the MySQL module loaded or you can't use the mysql_(p)connect functions."

In php7 mysql_* has been deleted you have to use mysqli or PDO instead.

You can read more about hereenter link description here

  • Should this connection be automatically enabled considering the versions downloaded? I have 'php_mysqli.dll' within C:\xampp\php\ext, amended the directory path within php.ini and uncommented the 'extension=php_mysqli.dll' in php.ini. Please could you provide more detail on how to 'use mysqli or PDO' and which file this function can be successfully amended? – A Bray Mar 02 '16 at 18:12
  • The error shows that you are using `mysql_*` extension. Your code must look like these: `mysql_connect("localhost", "user", "password");` You have to change this to `$conn = new mysqli("localhost", "user", "password", "database");`Check this [link](http://stackoverflow.com/questions/10703426/php-pdo-and-mysqli?rq=1) to review how to change your code – Eduardo Salazar Mar 02 '16 at 18:43
  • I'm following this tutorial (https://www.youtube.com/watch?v=740kEwoRPKk) and at no point does it connect to php via code. Is this because it's connected via recordset in Dreamweaver CC? The lack of connection code in this tutorial is confusing. Should I have a separate connect.php file (with relevant code) located in my XAMPP server folder in order to provide a connection? I assume that the 'recordset' function in Dreamweaver is featured to replace writing this code in the php file manually, meaning the connection settings in Dreamweaver are outdated. Is it possible this may be the issue? – A Bray Mar 06 '16 at 23:35
0

The error shows that you are using mysql_* extension. Your code must look like these: mysql_connect("localhost", "user", "password");. You have to change this to $conn = new mysqli("localhost", "user", "password", "database");. Check this link to review how to change your

sr9yar
  • 4,850
  • 5
  • 53
  • 59