your php server doesnt have the mysql module loaded or you c

Problems with the Windows version of XAMPP, questions, comments, and anything related.

your php server doesnt have the mysql module loaded or you c

Postby DarthSidus » 11. December 2016 12:37

Hi I am trying to make a connection with the database in dreamweaver cs6 but when i go to do it the following error message is displayed and i have no idea how to fix it:

your php server doesnt have the mysql module loaded or you cant use the mysql_(p) connect functions
DarthSidus
 
Posts: 6
Joined: 24. January 2016 13:07
Operating System: windows 10

Re: your php server doesnt have the mysql module loaded or y

Postby Nobbie » 11. December 2016 13:30

Which Xampp did you install? Your description lacks any information about that.

I assume, that you have a PHP 7 Version included, because in PHP 7 the mysql_XXXX functions have been removed. Either adapt your PHP script and use mysqli_XXXX functions instead, or do not use PHP 7, you must go back to PHP 5 Version. You will find appropriate installers on Xampps Download Page.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: your php server doesnt have the mysql module loaded or y

Postby DarthSidus » 11. December 2016 13:37

Hi Sorry i have installed xampp 7.0.13 / PHP 7.0.13. How can I adapt my php script and use mysqli_xxxx bearing in mind im a newbie
thanks

Darth
DarthSidus
 
Posts: 6
Joined: 24. January 2016 13:07
Operating System: windows 10

Re: your php server doesnt have the mysql module loaded or y

Postby JJ_Tagy » 11. December 2016 14:49

As a newbie, you should learn from the manual (you've probably heard RTFM before) or tutorials. Check out http://php.net/manual/en/function.mysqli-connect.php and http://www.w3schools.com/php/func_mysqli_connect.asp
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: your php server doesnt have the mysql module loaded or y

Postby Nobbie » 11. December 2016 15:19

DarthSidus wrote:How can I adapt my php script and use mysqli_xxxx bearing in mind im a newbie


There are two options:

a) either edit all your scripts and replace all mysql_xxxx by the corresponding mysqli_xxxx call. CAUTION: the parameter of the functions are NOT identical mysql/mysqli, get you the documentation about mysqli and replace all functions carefully

b) do NOT edit all your script by replacing all mysql_xxxx calls, instead create a single PHP script which declares and rebuilds all mysql_xxx functions via mysqli_xxxx functions. For example:

Code: Select all
<?php

function mysql_connect ($server, $username, $password) {

        return mysqli_connect($server, $username, $password);
}

function mysql_xxxx ....
....

...
?>


Finally include this script into all your PHP scripts which handle with mysql_xxxx functions. This second solution is kind of "quick&dirty", it is better to replace all mysql_xxxx directly via mysqli_xxxx and eventually to adapt the parameters for the corresponding call. This is unfortunately not an easy job for a beginner.

Last not least you may of course go back to PHP 5, probably easier for a newbie.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: your php server doesnt have the mysql module loaded or y

Postby DarthSidus » 11. December 2016 16:02

Which version of xampp should i install?

I would also be very grateful if you could give me step by step instructions on option b fir xampp v7

Regards

Darth
DarthSidus
 
Posts: 6
Joined: 24. January 2016 13:07
Operating System: windows 10

Re: your php server doesnt have the mysql module loaded or y

Postby DarthSidus » 11. December 2016 20:51

Nobbie wrote:
DarthSidus wrote:How can I adapt my php script and use mysqli_xxxx bearing in mind im a newbie


There are two options:

a) either edit all your scripts and replace all mysql_xxxx by the corresponding mysqli_xxxx call. CAUTION: the parameter of the functions are NOT identical mysql/mysqli, get you the documentation about mysqli and replace all functions carefully

b) do NOT edit all your script by replacing all mysql_xxxx calls, instead create a single PHP script which declares and rebuilds all mysql_xxx functions via mysqli_xxxx functions. For example:

Code: Select all
<?php

function mysql_connect ($server, $username, $password) {

        return mysqli_connect($server, $username, $password);
}

function mysql_xxxx ....
....

...
?>


Finally include this script into all your PHP scripts which handle with mysql_xxxx functions. This second solution is kind of "quick&dirty", it is better to replace all mysql_xxxx directly via mysqli_xxxx and eventually to adapt the parameters for the corresponding call. This is unfortunately not an easy job for a beginner.

Last not least you may of course go back to PHP 5, probably easier for a newbie.


Which version of xampp should i install?

I would also be very grateful if you could give me step by step instructions on option b fir xampp v7

Regards

Darth
DarthSidus
 
Posts: 6
Joined: 24. January 2016 13:07
Operating System: windows 10

Re: your php server doesnt have the mysql module loaded or y

Postby Nobbie » 12. December 2016 12:12

DarthSidus wrote:Which version of xampp should i install?


The latest which includes PHP 5, that is any Xampp 5.x (please simply look at the Download site, you cannot overlook it).

DarthSidus wrote:I would also be very grateful if you could give me step by step instructions on option b fir xampp v7


Sorry, no. That is already a very usefull and fully explained solution, the next step whould already result in writing the whole module for you. I am not intended to do that (that exceeds the free and voluntary help in this forum by far) and it also would not improve your own knowledge, you would stay a newbie further. I told you, its not easy for a newbie but thats as it is. We all have been newbies and had to go the long and hard way to become a skilled PHP programmer.

You still have the option to use Xampp 5 instead, which still contains the mysql functions.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 125 guests

cron