TESTING MYSQL

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

TESTING MYSQL

Post by Parody »

Im new to MYSQL, so this is probably a really easy question to answer.

How do I test to see if a MYSQL database works with all my php pages?

Reason: I have coded some php pages that need data from a MYSQL database and I don't want to have to upload everything to a server somewhere in 'Cyberspace' only to find out there are some major problems. Is there a program that can 'pretend' to host a MYSQL database on my computer?

:? :? :D
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

viewtopic.php?t=21400

read "Install a local server"
Sphen001
Forum Contributor
Posts: 107
Joined: Thu Mar 10, 2005 12:24 pm
Location: Land of the Beaver

Post by Sphen001 »

Hi,

What you are looking for is to create a localhost server enviroment. In effect, you will be installing a server on your computer. There are several pre-packaged ones that you can find on the internet, that come with PHP, MySQL, and Apache. You can find a lot of them at http://www.hotscripts.com . One of the most popular ones is EasyPHP. Once you have it installed, you will have a localhost server enviroment where you can test your scripts.

Hope this helps :D

Sphen001
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

Post by Parody »

I'm just about to install EASYPHP but, one question, apart from editing the php ini file do I have to do anything else or will it all be done for me?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

its pretty much "out of the box"
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

Post by Parody »

Only one error:

A mysql port is being used by mysqld-nt.exe
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

Post by phpScott »

that means you already have mysql installed.
remove it then rerun your program.
Parody
Forum Contributor
Posts: 252
Joined: Fri May 06, 2005 7:06 pm
Location: Great Britain

Post by Parody »

It works now, that problem has been fixed anyway. But, I get this error:

Code: Select all

Fatal error: Call to undefined function mysql_connect() in c:\program files\apache group\Apache\htdocs\test_mysql.php on line 3

When I use this line of code:

Code: Select all

$dbh = mysql_connect(&quote;localhost&quote;, &quote;localhost&quote;, &quote;root&quote;);
That is line 3 by the way.


THANKS :D
ody
Forum Contributor
Posts: 147
Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK

Post by ody »

In you php.ini do you have

;extension=php_mysql.dll

uncommented? by this I mean without the ';'. If not uncomment it and restart Apache.
User avatar
Mastermind
Forum Commoner
Posts: 36
Joined: Thu Mar 10, 2005 2:38 am
Location: CDO,Philippines
Contact:

Post by Mastermind »

Post Reply