HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Programming/Scripts (http://www.howtoforge.com/forums/forumdisplay.php?f=7)
-   -   help with php5 and mysql on ubuntu lamp. (http://www.howtoforge.com/forums/showthread.php?t=30958)

meomike2000 5th February 2009 08:35

help with php5 and mysql on ubuntu lamp.
 
i have been using php for a short while now and am starting to add on mysql database.
i have been reading a book about using php and mysql together and i have a sample script from that book that i have linked from my home page.
when i click on the link i get this error:

Fatal error: Call to undefined function mysql_connect() in /home/mike/Desktop/web/testdatabase.php on line 7

lines 6, 7, and 8 of my code is:

//open connection to database server.
$connection = mysql_connect('localhost', 'directory', 'directory')
or die ('unable to connect!');

the server is mine (ubuntu8.04 with php5) and this is not actually on the net, just my local machine.
as i am new to this and the book dont say anything about this "function" i could use a little help.

thanks in advance mike......

meomike2000 5th February 2009 09:03

fixed
 
i seam to have fixed the problem somehow .........

meomike2000 9th February 2009 02:41

the fix to my problem was
 
i had to add php5-mysql (the mysql module for php5). then i restarted the machine and all worked well.

vaene 6th March 2009 19:06

How?
 
I am having the same problem, how did you add the php5-mysql module if you don't mind my asking?

meomike2000 6th March 2009 19:12

how i fixed.
 
i have a desktop on the machine and i used the package manager under
system->admin->package manager.

you could also apt-get install phpmyadmin ether should work.


how are you trying to use the php. do you have apache or a similar web server
installed.....


All times are GMT +2. The time now is 02:16.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.