Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 8th, 2005, 3:40 PM   #1
HelloWorldProgram
Newbie
 
Join Date: Jul 2005
Posts: 6
Rep Power: 0 HelloWorldProgram is on a distinguished road
another simple question about PHP and mySQL

I am trying to check for access to my database(mysql), therefore I type the following code, and I save it as a php file and I try to run it from my local server in Apache, but an error displays "Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\helloworld.php on line 3. My OS is XP
".

<?php
$conn=mysql_connect("localhost","name","password");
echo $conn;
mysql_close($conn);
?>
HelloWorldProgram is offline   Reply With Quote
Old Jul 9th, 2005, 7:10 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8 Ooble is on a distinguished road
You have to enable php_mysql.dll and php_mysqli.dll in php.ini. You do this by removing the semicolon from these two lines:
;extension=php_mysql.dll
;extension=php_mysqli.dll
Then restart the Apache server.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jul 9th, 2005, 3:07 PM   #3
HelloWorldProgram
Newbie
 
Join Date: Jul 2005
Posts: 6
Rep Power: 0 HelloWorldProgram is on a distinguished road
Ok, but what directory do i have to go to make those changes? I couldn't fine any php_ini. The only directory I found with the files php_mysql.dll and php_mysqli.dll was c/php5/ext and these files didnt have any ; . Where do I have to go to type the while loop an stuff...Please can you explain in more details, I really appretiate your help.
HelloWorldProgram is offline   Reply With Quote
Old Jul 9th, 2005, 3:18 PM   #4
Overmind
Professional Programmer
 
Overmind's Avatar
 
Join Date: Jun 2004
Location: South Africa, Johannesburg
Posts: 301
Rep Power: 5 Overmind is on a distinguished road
If you don't know where the file is, then just do a search for it. Open it with notepad, then go Edit->Find, then type in: ;extension=php_mysql.dll and press ok. Take away the semi colon, do the same for ';extension=php_mysqli.dll'
__________________
[SIGPIC][/SIGPIC]
Overmind is offline   Reply With Quote
Old Jul 9th, 2005, 9:38 PM   #5
HelloWorldProgram
Newbie
 
Join Date: Jul 2005
Posts: 6
Rep Power: 0 HelloWorldProgram is on a distinguished road
This is what i get when i open the file with notepad:

MZ?       ÿÿ  ¸       @                                   ð   º ´	Í!¸LÍ!This rogram annot be run in DOS mode.
$       5¬ßqÍpŒqÍpŒqÍpŒ
Ñ|ŒsÍpŒÒzŒtÍpŒÒtŒsÍpŒòÅ-ŒsÍpŒqÍqŒ
HelloWorldProgram is offline   Reply With Quote
Old Jul 9th, 2005, 11:17 PM   #6
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
You are looking for a file named "php.ini" most likely, not a .dll file.
__________________

tempest is offline   Reply With Quote
Old Jul 10th, 2005, 6:40 PM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8 Ooble is on a distinguished road
You see those files called php.ini-dist and php.ini-recommended? Append "C:\PHP" or whatever your PHP location is to your PATH environment variable. You do this by going to Control Panel -> System -> Advanced -> Environment Variables, double-clicking on "Path" and adding ";C:\PHP" to it, then clicking OK a few times. Then make a copy of php.ini-recommended and call it php.ini. Then make the changes.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC