PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old December 21st, 2002, 09:51 AM
chrisutley chrisutley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 chrisutley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Newbie: Call to undefined function: mysql_connect()

I'm learning PHP after spending years working with PERL, ColdFusion, and ASP. I wrote some PHP on my PowerBook running Apache, MySQL, and PHP 4.2.3. I moved them over to my Redhat machine and encountered a goofy error:


Fatal error: Call to undefined function: mysql_connect() in /usr/www/html/session-manager/test.php on line 4

So I'm thinking perhaps MySQL isn't enabled in my Redhat install of PHP, so I pull phpinfo(). The following line is under "Configure Command":

'--with-mysql=shared,/usr'

I assume this means MySQL functions should be enabled. Is there anything else I could be missing here?

Thanks in advance and Happy Holidays!

-Chris

Reply With Quote
  #2  
Old December 21st, 2002, 11:15 AM
hermawan's Avatar
hermawan hermawan is offline
Superman is not dead
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Jakarta, Indonesia
Posts: 553 hermawan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 44 m 37 sec
Reputation Power: 3
Send a message via ICQ to hermawan Send a message via AIM to hermawan Send a message via Yahoo to hermawan Send a message via Google Talk to hermawan Send a message via Skype to hermawan
RE: Newbie: Call to undefined function: mysql_connect()

Well, with that configuration it should makes PHP can connect to mysql using that function. Re-check again if you misstype the function ?

Reply With Quote
  #3  
Old December 21st, 2002, 11:15 AM
hermawan's Avatar
hermawan hermawan is offline
Superman is not dead
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Jakarta, Indonesia
Posts: 553 hermawan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 44 m 37 sec
Reputation Power: 3
Send a message via ICQ to hermawan Send a message via AIM to hermawan Send a message via Yahoo to hermawan Send a message via Google Talk to hermawan Send a message via Skype to hermawan
RE: Newbie: Call to undefined function: mysql_connect()

Well, with that configuration it should makes PHP can connect to mysql using that function. Re-check again if you misstype the function ?

Reply With Quote
  #4  
Old December 21st, 2002, 12:12 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 25
RE: Newbie: Call to undefined function: mysql_connect()

I don't think it was a type-o, as the same exact code was working on my Mac just fine, but I appreciate any and all feedback!

Here is the actual code:

php Code:
Original - php Code
  1.  
  2. <!--
  3. DB_Functions.inc
  4. A collection of useful DB functions.
  5.  
  6. created:  07.20.02
  7. author:   CJU
  8.  
  9. modified: 10.14.02
  10. coder:    CJU
  11.  
  12. © 2001-2002 Copyright NetOrigin LLC.  All rights reserved.
  13. -->
  14.  
  15. <?php
  16.  
  17. ## FUNCTIONS
  18.  
  19. // Open a connection to mySQL, then init access to specific database
  20. function my_accessDB($db_name, $print_error) {
  21.     global $link;
  22. /*
  23. If you use "root" to run mySQL on a production system you are asking for major trouble.  This is configured this way for a workstation not accessible via. the Internet.
  24. */
  25.     $link = mysql_connect("localhost", "chris", "public");
  26.     if ( mysql_select_db($db_name) ) {
  27.         return ("true");
  28.     } else {
  29.         print "Could not open database: $db_name<p>";
  30.         return "false";
  31.     }
  32. }
  33.  
  34. ?>

Reply With Quote
  #5  
Old December 21st, 2002, 05:29 PM
bob0099 bob0099 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: manchester,n.h.,usa
Posts: 172 bob0099 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Newbie: Call to undefined function: mysql_connect()

found this in the bugzilla section of REDHAT.com:

http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=75033

This is for red hat linux 8.0. It may be your problem.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Newbie: Call to undefined function: mysql_connect()


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek