473,800 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MySQL problem: Call to undefined function mysql_connect()

hello
i am not able to get mysql running.
you can get my server/php settings/details here:
http://damn-i-have.no-ip.com/phpinfo.php

i already enabled the following stuff in my php.ini

NOTE: i installed php to C:\php and got the ext dir in the install
dir.
extension_dir = "C:\php\ext "
extension=php_m ysql.dll

i am still getting this error:
Fatal error: Call to undefined function mysql_connect() in C:\httproot
\mysqltest.php on line 2

i use this sorcecode:
<code>
<?php
$link = mysql_connect(' localhost', '*****', '******');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($li nk);
?>
</code>
any ideas?

PS: mysql is running on standard port 3306 and i can access it with my
mysql query browser, with the user i use in php.

Jul 26 '07 #1
7 3406
Rik
On Thu, 26 Jul 2007 17:52:19 +0200, <lu******@gmail .comwrote:
hello
i am not able to get mysql running.
you can get my server/php settings/details here:
http://damn-i-have.no-ip.com/phpinfo.php

i already enabled the following stuff in my php.ini
Are you sure, the phpinfo() output doesn't reflect it? There may be
several php.ini's, the one currently in use is C:\PHP\php.ini. If that's
the one you altered, try restarting apache.

The rest seems OK.
--
Rik Wasmus
Jul 26 '07 #2
yes, i am editing C:\PHP\php.ini
and i already rebooted the whole system...

Jul 26 '07 #3
On Jul 26, 12:37 pm, lumo2...@gmail. com wrote:
yes, i am editing C:\PHP\php.ini
and i already rebooted the whole system...
is C:\PHP\php.ini in your environmental path?

Did you have to move a php.ini into your sys32 directory during
installation? If so (or if there is one there), overwrite that file
with the new(modified) file. Then, restart IIS.

-Steve

Jul 26 '07 #4
On Jul 27, 1:52 am, lumo2...@gmail. com wrote:
hello
i am not able to get mysql running.
you can get my server/php settings/details here:http://damn-i-have.no-ip.com/phpinfo.php

i already enabled the following stuff in my php.ini
--SNIP--

Your apache might not use that particular php.ini that you have edited
(or have mysql ext enabled).

To make sure that apache uses the correct
php.ini, add the following directive to apache conf

PHPIniDir "C:/PHP"

Replace C:/PHP to your php.ini directory.

Hendri Kurniawan

Jul 26 '07 #5
PHPIniDir "C:/PHP"

i already have that set (the php installer did that for me, and i
checked now for sure)
further i only have ONE php.ini on my whole system, so it cant load
anything else.
AND if i enable gd2 in my php.ini it gets loaded properly. if i enable
mysql nothing happens.
means phpinfo shows me that gd is loaded but nothing about mysql

and yes, my path is:
C:\PHP\;%System Root%\system32; %SystemRoot%;%S ystemRoot%\Syst em32\Wbem

any other ideas?

i can upload my php.ini and httpd.conf if needed

Jul 27 '07 #6
SOLVED!!!!

there was no libmysql.dll in my windows\system3 2 directory!
i downloaded it and put it there now its working

thanks for your help!

Jul 27 '07 #7
On 26 Jul, 21:27, ELINTPimp <smsi...@gmail. comwrote:
On Jul 26, 12:37 pm, lumo2...@gmail. com wrote:
yes, i am editing C:\PHP\php.ini
and i already rebooted the whole system...

is C:\PHP\php.ini in your environmental path?

Did you have to move a php.ini into your sys32 directory during
installation? If so (or if there is one there), overwrite that file
with the new(modified) file. Then, restart IIS.

-Steve
If he's using Apache, why would he want to restart IIS?

Jul 27 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3866
by: das dsf | last post by:
Hi there! I have both PHP 4.0( RPM) installed and MySQL 4.0.20 installed with the mysqld daemon up and running. But when I look at the output of phpinfo() , I do not see it there, which is worrisome and so I tried to recompile PHP and do ./configure with the --with-mysql=path but I don't really know where my mysql's header files should be , is there any way to find that out by using any of the mysql commands? I did try to do...
0
2077
by: W i l l | last post by:
I have Apache 2 parsing and serving PHP files just fine on my winXP box, however, when I try to add some mysql database functionality I get a warning that looks like this: Fatal error: Call to undefined function mysql_connect() in D:\SITES\mysql.php on line 3 I am able to connect to mysql via the terminal just fine. Due to the error "undefined function" I wonder if I set PHP up wrong or something. Any ideas?
5
1417
by: ligerdave | last post by:
i run php4+mysql+apache2 on linux(ubuntu). every time i try to use mysql_connect function, it says something like this: Fatal error: Call to undefined function: mysql_connect() in /home/ligerdave/website/test.php on line 13 plz help!!!!!
4
2472
by: gregsands | last post by:
Hi I have read all (ok most) of the posts relating to "Call to undefined function mysql_connect()", read the manual on PHP.net and done eveything thats ive been asked to do but cant get PHP to talk to MySQL, PHP is working fine but I dont get any mysql info when running <? phpinfo() ?> and get the "Call to undefined function mysql_connect()" when trying to connect to mysql through php in browser, please help. 1. I have added C:\php;...
3
1596
by: Martin | last post by:
I'm having trouble getting a new PHP/MySQl installation to work. Windows XP Pro, IIS 5.1, PHP 5.1.1, MySQL 5.0.16, ISAPI This is a new computer. The whole setup is for development use only - no access from beyond my own network. PHP seems to be working OK. I can open a test.php page ok - It executes down to the statement where I try to connect to the MySQL database. At that point, nothing further happens. The page is served
6
2705
by: Mike | last post by:
I'm new to MySQL. I have a copy of MySQL on my PC but it appears the only way to create a database is through a shell. I have a copy of MySQL-Front but I can't get it to connect to the database. I've used localhost and root and no password but it gives the error "Cannot connect to MySQL Server on "localhost"! Any ideas or is there another way to create a database without using the shell.
7
13491
by: Kurda Yon | last post by:
Hi everybody, I cannot understand the following thinks. The last line of the fillowing code produces a message about mistake (not a valid MySQL- Link resource): $link = mysql_connect( "localhost","tmp_user","tmpxxx" ); mysql_select_db( $db_name, $link); $link = mysql_connect( "localhost","tmp_user","tmpxxx" ); mysql_close( $link );
9
3189
by: christopher_board | last post by:
Hi all. I am trying to connect to a MySQL Database using PHP on a local machine using locahost. I am using the following code <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
11
13216
by: Kurda Yon | last post by:
Hi, I got this warning: mysql_query(): 4 is not a valid MySQL-Link resource. The line which cause this warning is: mysql_query("insert into $tablename (id,priority) values('$id', '0.00')", $link2); As far as understand the problem is that $link2 is "not a valid MySQL-
0
9691
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
9551
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
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
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
9090
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
6813
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
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
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.