How to connect to MySQL5 via PHP??

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
sj1983msh
Forum Newbie
Posts: 15
Joined: Thu Feb 28, 2008 12:01 pm

How to connect to MySQL5 via PHP??

Post by sj1983msh »

Hi everyone,

I have a problem with my new MySQL Version. I have installed MySQL 5 recently (I was working with MySQL 4....).
MySQL is working well and I can do anything via Commandprompt (windows platform) with it.
But I when I want to run a script that connects to the DataBase it gives me a fatalerror that says for example "mysql_connect() is not defined ....."

I also can't run MyPHPAdmin for MySQL5.

What should I do? Please help me through this.

ps. I use IIS, and PHP5.

Sincerely Yours
Saman J.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: How to connect to MySQL5 via PHP??

Post by s.dot »

PHP5 does not come with the mysql extension enabled "out of the box" like PHP4 did. You will need to enable the extension.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply