Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 2nd, 2005, 04:28 AM
Authorized User
 
Join Date: Nov 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tks_muthu
Default Call to undefined function mysql_connect()

hi all!

i am using windows xp and iis 6.0. whenever i open the php page
i got the following error message:-

Call to undefined function mysql_connect()
my source :

<?php
$db_name='sample';
$conn=mysql_connect('servername','username','passw ord') or die('Error connecting to mysql');
mysql_select_db('db_name');
?>

plz help.



Muthu
__________________
Muthu
 
Old June 2nd, 2005, 07:06 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

>> Call to undefined function mysql_connect()

First are you using PHP 5? and see if phpinfo() shows MySQL module.

 
Old June 14th, 2005, 01:23 AM
Registered User
 
Join Date: Jun 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to sunnybaba
Default

Quote:
quote:Originally posted by tks_muthu
 hi all!

i am using windows xp and iis 6.0. whenever i open the php page
i got the following error message:-

Call to undefined function mysql_connect()



Muthu
Aaaaaaaaah php5 and its curious ways!
The reason it happens is because PHP5 does not provide built-in
support for MySql (like PHP4 and below did).
Here's a webpage with a fix for the problem.
http://www.siteinaweek.com/installphp5/howto.php







Similar Threads
Thread Thread Starter Forum Replies Last Post
Fatal error: Call to undefined function mysql_pcon surendran Beginning PHP 2 May 23rd, 2006 10:41 PM
i can not use the mysql_connect() function g.tamilselvan MySQL 2 February 14th, 2006 09:03 AM
Undefined function dhborchardt Classic ASP Databases 0 June 7th, 2004 03:31 PM
error Call to undefined function: query() gmanon Wrox Book Feedback 1 November 20th, 2003 06:34 PM
undefined function: mysql_connect() shabboleth Beginning PHP 2 September 18th, 2003 05:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.