PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

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 Dev Shed Forums Sponsor:
  #1  
Old November 28th, 2012, 03:01 AM
iamvasi iamvasi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 1 iamvasi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 58 sec
Reputation Power: 0
PHP-Install - Call to undefined function mysql_connect() in /Users/praveenvasireddy/localhost/test/

I am a newbie to LAMP stack. I believe I have setup apache,php and mysql correctly. I am using Mac Pro, and OS version is 10.8.2


While installation I modified php.ini to include mysql.default_socket = /tmp/mysql.sock



Modified httpd.conf to uncomment php module.



When I run a webpage with phpinfo(), below is a snippet from the same.


mysqlnd


mysqlnd enabled
Version mysqlnd 5.0.8-dev - 20102224 - $Id: 65fe78e70ce53d27a6cd578597722950e490b0d0 $
Compression supported
SSL supported
Command buffer size 4096
Read buffer size 32768
Read timeout 31536000
Collecting statistics Yes
Collecting memory statistics Yes
Tracing n/a





Code which fails is on line 2 of the test page.


PHP Code:
<?php

    $con 
mysql_connect("127.0.0.1","root","");

    if (!
$con)

    {

        die(
'Could not connect: ' mysql_error());

    }

    
$fname $_POST["fname"];

    
$lname $_POST["lname"];

    
$add1 $_POST["add1"];

...

...



FYI ... prior to setting up apache,php and mysql seperately I tried XAMPP and the same code back worked.



Please help me what need to get configured to make sure that php connects to localhost mysql.



Thank you in advance.

Reply With Quote
  #2  
Old November 28th, 2012, 03:26 AM
Northie's Avatar
Northie Northie is offline
Square Peg in a Round Hole
Click here for more information.
 
Join Date: Oct 2007
Location: North Yorkshire, UK
Posts: 3,415 Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level)Northie User rank is General 43rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 9 h 21 m 40 sec
Reputation Power: 3833
try installing apache, mysql and php by downloading and installing xampp

Then, if you're new to PHP bypass the whole mysql_* functions and concentrate on PDO (PHP Data Objects) - its a neater, cleaner set of objects and functions to use when interfacing to a database
__________________
PHP OOPS! <?php DB::Execute(SQL::makeFrom($_GET))->fetchArray()->FormatWith(Template::getInstance('default'))->printHtml(); ?>

PDO vs mysql_* functions: Find a Migration Guide Here

[ Xeneco - T'interweb Development ] - [ Are you a Help Vampire? ] - [ Read The manual! ] - [ W3 methods - GET, POST, etc ] - [ Web Design Hell ]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-Install - Call to undefined function mysql_connect() in /Users/praveenvasireddy/localhost/test/

Developer Shed Advertisers and Affiliates



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

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


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap