Jump to content


Photo

PHP/MYSQL


  • Please log in to reply
3 replies to this topic

#1 Big X

Big X
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 30 April 2006 - 04:07 PM

I am running php 5 and apache server on my computer. I am currently learning php at uni and we are using Mysql. I have just installed mysql on my machine and have run the server successfully and used mysql browser to open a script and populate some tables for some exercises I have done at Uni. I then procceded to change the php database connection information and run the files from home and I am recieving an error.

Fatal error: Call to undefined function mysql_connect() in D:\Apache Group\Apache2\htdocs\NightClassBrett\week 10\nw.php on line 27

The line it is reffering to is
$db=mysql_connect("localhost","root" ,"root");

The localhost psw and username are definatly correct. I set the psw to root.
Any ideas to what I may have done wrong in installation that could be causing this problem

I have also removed the ' in front of the line 'extension=php_mysql.dll
which I believe was nessacery. Is there any other alteration to the php.ini file I need to make ?

any help would be aprreciated.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 30 April 2006 - 04:29 PM

Did you set up the extension_dir directive? Look for the following line in the php.ini:
extension_dir = "./"
change ./ to the full path to where the php extension folder is located to, ie C:\php\ext

Now you need to save the php.ini and look a for a file called libmysql.dll and copy that to the Windows folder or add the php folder to the Windows PATH variable instead, saves moving any files.

Now restart your Apache web server and you should be able to use the mysql functions.

#3 Big X

Big X
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 30 April 2006 - 04:54 PM

Ok I got it working did a goodle search. I had just grabbed everything mysql*.dll and dumped it in the root. Info on the net was a bit scetcy as to which file goes where. I dont know if you can answer my next question because it is more mysql related but here goes. When I start the mysql server I ran the MySQLInstanceConfig.exe file. In the task manager I notice mysqld-nt.exe is running. At uni we run the mysql.exe to get the server going. The file is in the bin folder but when I go to run it the dos window comes up and closes. Even when I double click on the mysqld-nt.exe myself after Ive shut it down the program through task manager I cannot start the server my self without going back to the MySQLInstanceConfig.exe which is about a ten step process. So I guess my question is, is there any difference with the mysqld-nt.exe which is launching now when I reboot my computer. Vrs the mysql.exe. And if I dont want to it to auto launch and just use it when nessecary what file in the bin folder do I load to get the server going. I have tried a few and I have been checking to see if server is running through task manager and launching mysql browser which fails to connect.



#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 30 April 2006 - 06:17 PM

You shouldn't run the .exe files in the bin folder directly. They are not designed be executed through windows explorer. The way you execute the files in the bin folder is the in the command line.

Click Start > Run > type in cmd and click OK. The Command Line window should appear. Now type in the following:
cd C:\MySQL\bin
and click enter now type in the following:
mysql-nt --install
This will start the MySQL service. Then to stop mysql use the following, in the correct order:
net stop MySql

mysql-nt --remove
Before you run the above command make sure you are in the MySQL bin folder.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users