20, July 2008

msql connection error - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: msql connection error
« previous next »
Pages: [1] Print

Author Topic: msql connection error  (Read 1265 times)
My name is Bong, James Bong
*
Gender: Male
Posts: 12
84 credits
Members referred : 0


the path to wisdom begins with humble ignorance


« on: Jun 24, 2007, 07:50:53 PM »

Hi guys I've been running through some php tutorials trying to minimized the painfully annoying newbie questions I throw out... but alas I am stuck again on what I am sure is another easy one for you pros. 

I am running PHP5 on apache 2.0.59 and mysql 5.0 which I configured manually I figured it would teach me a thing or 2 about the inner workings of the lot  Embarrassed so much for that! ...once again i'm stuck.


I am trying to connect to mysql through php with this code:

$con = mysql_connect("localhost","root","mypassword");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }


and I get this error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\htdocs\phppractice\msql_connect.php

this is on a machine running windows XP pro with SP2 PLEEEASE HELP!!!!
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #1 on: Jun 24, 2007, 08:49:38 PM »

In php 5 mysql is not enabled by default. Open the php.ini file and add this :

Code:

extension=php_mysql.dll


Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
My name is Bong, James Bong
*
Gender: Male
Posts: 12
84 credits
Members referred : 0


the path to wisdom begins with humble ignorance


« Reply #2 on: Jun 24, 2007, 09:49:19 PM »

I had figured that might be the problem and it was in the PHP.ini file already, I uncommented it and restart the apache server but I am still getting the error.
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Jun 24, 2007, 10:55:03 PM »

thats nor true, mysql is a native lib in php 5 (at least the latest releases) try zend core:

http://www.zend.com/products/zend_core Visit through proxy

 


Last blog : 4th of July Lottery from TemplateMonster.com
My name is Bong, James Bong
*
Gender: Male
Posts: 12
84 credits
Members referred : 0


the path to wisdom begins with humble ignorance


« Reply #4 on: Jun 25, 2007, 03:14:01 AM »

thanks Olaf I installed zend core and I'm back in the game... and its really cool too!  Grin
My name is Bong, James Bong
*
Gender: Male
Posts: 12
84 credits
Members referred : 0


the path to wisdom begins with humble ignorance


« Reply #5 on: Jun 25, 2007, 03:29:55 AM »

can anyone point me to some nice resources for php scripts I can download and practice with?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Jun 25, 2007, 09:02:29 AM »

thanks Olaf I installed zend core and I'm back in the game... and its really cool too!  Grin

great, I need to test this too (on a new machine)!

Quote
can anyone point me to some nice resources for php scripts I can download and practice with?

with Zend core you got the Zend framework, Check the related tutorials on zend.com (devzone), this way you will learn php5 (don't learn coding with php4) from the beginning and maybe you will push php5 on this forum too Wink


Last blog : 4th of July Lottery from TemplateMonster.com
Where are my glasses?
*
Posts: 21
138 credits
Members referred : 0


« Reply #7 on: Jul 20, 2007, 02:36:49 AM »

The MySQLi extension has a better performance than MySQL and is fully object oriented. If you're planning to use Windows for production use, I highly recommend not to use Apache. I had many problems with my Microsoft Windows 2003 server and Apache (Apache assigned too much RAM and didn't free up -> The used space became bigger and bigger and we couldn't access the server anymore. I read in some boards that I was not the only person having that problem. I think it's because of Winsock but I don't know for sure). Having switched to LightTPD I don't have any problems anymore and the pages are loadng much faster. Even big pages such as YouTube are using LightTPD. But the best way is to use Linux. On my Linux webserver I never have had problems with high RAM usage.
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Jul 20, 2007, 09:42:28 AM »

Tim,

this is interesting, I have a small webserver (for fetching thumbnails from websites) at home (a WAMP configuration) and YES I have a lot off errors.
I though the errors are related to unclosed threads in apache.

I will try LightTPD thanks!

EDIT:

I guess you suggest to use this install?
http://www.kevinworthington.com:8181/?p=85 Visit through proxy
« Last Edit: Jul 20, 2007, 09:47:55 AM by Olaf »


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #9 on: Jul 20, 2007, 11:28:09 AM »

If you are using windows you need to be careful. You should close the connection or use a persistent one to make it work better. Of course if you are using linux everything would be better Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Jul 20, 2007, 11:40:17 AM »

If you are using windows you need to be careful. You should close the connection or use a persistent one to make it work better. Of course if you are using linux everything would be better Smiley

there is in windows no apache directive for preforc etc. or are you talking about mysql connections?


Last blog : 4th of July Lottery from TemplateMonster.com
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 7970
40777 credits
Members referred : 3



« Reply #11 on: Jul 20, 2007, 01:54:19 PM »

I was talking for mysql

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : MIA - Where Nick and Tim
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #12 on: Jul 20, 2007, 02:21:50 PM »

I was talking for mysql

I don't use mysql for this windows server Smiley


Last blog : 4th of July Lottery from TemplateMonster.com
Where are my glasses?
*
Posts: 21
138 credits
Members referred : 0


« Reply #13 on: Jul 20, 2007, 03:16:04 PM »

Olaf, what sort of errors do you have? I didn't like the directory structure of Kevin Worthington's LightTPD installer. I made a batch file which is adapted to fit the needs.
Here you can download it: http://rapidshare.com/files/43987523/install.tar.html Visit through proxy
My name is Bong, James Bong
*
Gender: Male
Posts: 12
84 credits
Members referred : 0


the path to wisdom begins with humble ignorance


« Reply #14 on: Jul 20, 2007, 04:14:18 PM »

one day I'll understand what you guys are talking about but until then... I'm still learning.
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #15 on: Jul 20, 2007, 04:28:44 PM »

Olaf, what sort of errors do you have? I didn't like the directory structure of Kevin Worthington's LightTPD installer. I made a batch file which is adapted to fit the needs.
Here you can download it: http://rapidshare.com/files/43987523/install.tar.html Visit through proxy

do I need CGIWIN for this barch?


Last blog : 4th of July Lottery from TemplateMonster.com
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6279
38500 credits
Members referred : 374


It's time to use PHP5!


« Reply #16 on: Jul 20, 2007, 04:30:03 PM »

one day I'll understand what you guys are talking about but until then... I'm still learning.

hehe, right I think this goes to far for your needs Smiley


Last blog : 4th of July Lottery from TemplateMonster.com
Where are my glasses?
*
Posts: 21
138 credits
Members referred : 0


« Reply #17 on: Jul 20, 2007, 05:59:38 PM »

Olaf, what sort of errors do you have? I didn't like the directory structure of Kevin Worthington's LightTPD installer. I made a batch file which is adapted to fit the needs.
Here you can download it: http://rapidshare.com/files/43987523/install.tar.html Visit through proxy

do I need CGIWIN for this barch?

Yes, but it's already included within the installer.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6846
Tags : php mysql Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: msql connection error
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 20, 2008, 04:43:43 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 35.668
Total Topics: 7.373
Total Members: 3.693
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: talelmouaada

35 Guests, 3 Users online :

5 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.