Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Programming/Scripts

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 5th February 2009, 08:35
meomike2000 meomike2000 is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 14
Thanked 0 Times in 0 Posts
Question 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......
Reply With Quote
Sponsored Links
  #2  
Old 5th February 2009, 09:03
meomike2000 meomike2000 is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 14
Thanked 0 Times in 0 Posts
Default fixed

i seam to have fixed the problem somehow .........
Reply With Quote
  #3  
Old 9th February 2009, 02:41
meomike2000 meomike2000 is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 14
Thanked 0 Times in 0 Posts
Question 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.
Reply With Quote
  #4  
Old 6th March 2009, 19:06
vaene vaene is offline
Junior Member
 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How?

I am having the same problem, how did you add the php5-mysql module if you don't mind my asking?
Reply With Quote
  #5  
Old 6th March 2009, 19:12
meomike2000 meomike2000 is offline
Member
 
Join Date: Apr 2007
Posts: 39
Thanks: 14
Thanked 0 Times in 0 Posts
 
Default 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.....
Reply With Quote
Reply

Bookmarks

Tags
mysql, php5

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
php5 and php4 at the same time Hans Installation/Configuration 15 22nd October 2008 13:02
MySQL problem satimis Server Operation 5 25th June 2008 15:41
CentOS 4.3 - PHP5 and MySQL 5 british.assassin Installation/Configuration 4 20th June 2006 14:20
eaccelerator installation - can't find php5-config tom Programming/Scripts 9 15th May 2006 15:36


All times are GMT +2. The time now is 08:47.


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