Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 14th, 2005, 12:20 PM
Authorized User
 
Join Date: Mar 2005
Location: arima, West Indies, Trinidad and Tobago.
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to arimakidd
Default Undefined Function Error

I am building this script step by step and the first step is not working. Simply to connect to mysql, here's the code:
Code:
$connect = mysql_connect("localhost","root","newman$") or
die ("Hey loser, check your server connection.");
echo "if you gotten this far it means things worked out";
Instead I get the following error:

Code:
Fatal error: Call to undefined function mysql_connect() in C:\apache\Apache2\development\mysql_up.php on line 11
Line 11 is as follows:
Code:
$connect = mysql_connect("localhost", "root", "newman$")
My OS is xp pro and I have successfully installed apache and php5. Mysql works fine at the command prompt. The script I am writting is in php and the entire thing is simple and short:
Code:
<?php
/*
$host = "localhost";
$user = "root@localhost";
$pass = "newman$";
*/
//connect to MySQL; note we've used our own parameters - you should use 
//you own for hostname, user, and password
$connect = mysql_connect("localhost", "root", "newman$") or
die ("Hey loser, check your server connection.");
?>
Need Help

Reply With Quote
  #2 (permalink)  
Old October 19th, 2005, 01:48 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

See o/p of phpinfo(). PHP5 has no automatic working module of MySQL, you need enable it.

`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Support Indian students' finances http://scholarship.mediasworks.com/
Reply With Quote
  #3 (permalink)  
Old November 10th, 2005, 02:54 AM
Registered User
 
Join Date: Nov 2005
Location: , , Pakistan.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do the following
1)include your php path (e.g c:\php)in the enviroment variables.
my computer-->Properties-->Advanced-->Enviroment Variables-->Select "PATH" from the list and press Edit.go to the end of line and
enter your php path for example c:\php

2)Copy php_mysql.dll to c:\php (or to your php path). if it is already there then ok.
   (you can find it in the ext folder of your php folder)
3)copy libmysql.dll to c:\php (or to your php path). if it is already there then ok.

4)Open php.ini file and add the following line in the extension list
   Extension=php_mysql.dll
  Save and close file.

5)restart your system.

6)Your above code is right now run it again.
          thanks (imran ali)

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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
undefined function vurtman ASP.NET 1.0 and 1.1 Basics 8 October 4th, 2004 01:32 PM
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



All times are GMT -4. The time now is 07:54 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.