473,805 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fatal error: Call to undefined function mysql_connect()

28 New Member
Please can some one help with my problem; I am running Apache web server on my lap top, plus a mysql server and php. The version of php currently installed is 5.2.5.
when i write some php to connect to my mysql database server instead of it connecting i get :
Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\h tdocs\chephrenr epairs\dataentr yprocess.php on line 16.

question 1 is this:
Is this happening because the version of php i have installed has no support for mysql bundled with it?

Question 2: Are there some versions of php 5 that have no support for mysql at all because it was removed by the php writters and if so which versions of php 5 do have mysql support built in to them that works properly?

I have looked on this forum and found that someone said that mysql support was removed in php 5, but it sdoes not say which version of php 5 it was removed from, neither does it hint as what to do to get php communicating twith the local mysql server??

if questions 1 and 2 have been answered in anther thread on this forum then please where???
Dec 28 '08
49 16298
Dormilich
8,658 Recognized Expert Moderator Expert
@Julian Bowler
yes, that's correct.
Dec 30 '08 #11
Julian Bowler
28 New Member
when i said in the previous but one posts that what i did worked, i.e. got php to run mysql functions correctly, well that's not true because when i run the correct php to connect to the local MySQL Server, i did not get the fatel error message suggesting that the function mysql_connect() has failed to work , instead I get just a blank page, with no writing in it at all??!
so what does that mean? does it mean that any of the php is working at all/ I am going to continue to try to figger this out, and what i find out will be in this thread on this forum i hope shortly, watch this space...!!!!???
Dec 30 '08 #12
Dormilich
8,658 Recognized Expert Moderator Expert
that looks like a PHP runtime error (e.g. a defect library). try to figure out which function may cause this (e.g. if a DB library is defect, php code without DB functions should work fine, something like that)
Dec 30 '08 #13
Julian Bowler
28 New Member
if i run a little php to echo some text to the screen that works, but what about the function $conn = mysql_connect(" localhost","USE R_NAME","PASSWO RD");
as we know there a lots of mysql php functions, but the one i am using simply is designed to make a connection to a database. it should either work or not work?
I need to look at whether error reporting is switched on or off, and what level of error reporting is enabled and possibly other things also. i need to also test to see if some other php functions not related to MySQL work ok. i will do some testing...
Dec 30 '08 #14
Dormilich
8,658 Recognized Expert Moderator Expert
@Julian Bowler
basicly yes. but the mysql library may be corrupted (then you get no output at all (not even error messages)) or there may be an error in the php.ini....

regards

one more thing: never ever post passwords (use something generic like "password")
Dec 30 '08 #15
Julian Bowler
28 New Member
that Old Estonian proverb comes to mind; If you think things are really bad don't worry yourself, things will definitely get worse.....

I have figured out that a simple echo command works fine so php in general seems just fine, next i will try to see firstly what the level of error reporting is at present and then play at changing it to see what happens....
Dec 30 '08 #16
Julian Bowler
28 New Member
oh yes, it is ok the password i posted is fake, it is not like the real one that will eventually be used on the live server... but thank you for mentioning this it is a good and valid point. on the real program i will us user names and passwords that will not be posted anywhere in any forum.
Dec 30 '08 #17
Dormilich
8,658 Recognized Expert Moderator Expert
then I'm relieved.

regards
Dec 30 '08 #18
Julian Bowler
28 New Member
I have now looked at php.ini and in it there are error handlingg andd loging section and in here there is
error_reporting = E_ALL
and
display_errors = Off
it is this line that is ensuring that no errors are being sent to the screen, i have changed it to say display _errors = On and then stopped and started Apache and hay now i see the message:

Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\h tdocs\chephrenr ep........... at line 20
So we see that the mysql function is still not working.....

so will go back to look at all the posts in this thread and see if i can try some of the ideas presented as well as googling the problem once more...??????.. .. what i discover will be posted here, any help from anyone in the know with php 5 configuration would be welcome along with the other people that have kindly posted help.. ...
Dec 30 '08 #19
Dormilich
8,658 Recognized Expert Moderator Expert
you could try the WAMP package....
Dec 30 '08 #20

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9985
by: BT | last post by:
Hi .. a newbie question. I get the following error: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/index.php on line 3. I have the following RPMS installed on RH7.2 MySQL-client-4.0.14-0 I would really appreciate it. MySQL-shared-4.0.14-0 MySQL-server-4.0.14-0 MySQL-devel-4.0.14-0
4
15347
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and MySql on WIN 2000. PHP is installed from the zip file. When serving php docs (code snippets below) I get the messages: "Fatal error: Call to undefined function mysql_connect() " "Fatal error: Call to undefined function mysql_pconnect() "
8
9998
by: Tim Tyler | last post by:
I'm getting fatal errors when executing code - and my error handler is failing to trap them - so I get no stack backtrace :-( The error I am getting is: "Fatal error: Call to a member function fetchRow() on a non-object." What are the available options here? Am I supposed to check I have a real object whenever I perform
1
13671
by: Mike | last post by:
Last weekend I decided to install Apache 2.0.53-win32-x86-no_ssl PHP 5.0.3 Smarty 2.6.7 MySQL essential-4.1.10-win32 I have Apache up (Port 80 blocked at the router and firewall!) and I have got Smarty working. I haven't got around to installing MySQL. I am now in chapter 8 'Error and Exception Handling' of
2
2382
by: inonzuk | last post by:
why strange you ask? here goes: I have been working with Php and Mysql for a week without any problems. Today I tried executing a php page that connects to mysql and creates a new database, I got this error: "Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\test\_debug_tmp.php on line 3". I did some reading on the net and checked all my configuration, and it
2
2003
by: Frobinrobin | last post by:
I am running Win2k3 Server and when I try to use the mysql_connect function I am getting an error: Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\programs\index.php on line 8 Now, I def know I've configured my php.ini correctly (its literally the same as my XP machine) and I know that mysql works fine with PHP as I can run it from the command line :D I've got the files (tried in multiple places - but...
5
4168
by: Grant Nosbush | last post by:
I have searched the newsgroups and the web trying to solve this problem and just can't get it. Maybe someone will be able to help. I am getting the following error when I try to view a test page in my browser. This test page just reads a table in mysql and outputs the results. Fatal error: Call to undefined function: mysql_connect() in /var/web/public/test.php on line 2 I'm using:
5
2783
by: awdsites | last post by:
Hi, I'm a noob with a server so keep that in mind :) Been trying to connect with php to mysql and all I get is: "Fatal error: Call to undefined function: mysql_connect()" I've read and read and can't figure out what is wrong. My current set up is:
9
5268
by: java | last post by:
Hey there, I just removed an elderly PHP4-Installation from my Windows-Box and installed PHP 5.2.1. I used the PHP4-Module as local batchfile- interpreter by E:\ersDHCP>php ./extractLog.php which was perfectly alright and worked well. But now PHP5 fails to run the same script without any modification!
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10103
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9179
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.