Can I edit the list of the blogs I've read?
Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\mysqlconnect.php
 on l
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What is interesting here?
• Duels
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Ñîîáùåñòâà
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > MySQL database development > Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\­mysqlconnect.php on l 29 January 2009 00:36:45

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Ìîäåðàòîð:

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\­mysqlconnect.php on l

Tony Aldemir 25 August 2005 22:31:04
 Hello There,

I am getting the "Fatal error: Call to undefined function mysql_connect()
in c:\Inetpub\wwwroot\­mysqlconnect.php on line 2" error when I try to
connect to the MySQL DB using:
<?php
$conn = mysql_connect("loca­lhost", "joeuser", "somepass");
echo $conn;
?>

I have made sure that my PHP.INI file is adjusted to reflect the following:

Uncommented the line "extension=php_mysq­l.dll" exposing this DLL to PHP.
I added the following line
extension_dir = "c:\php\ext"

I copied the libmySQL.dll to the c:\inetpub\wwwroot folder (I am using the
IIS on this machine, but I have the same configuration using the latest
APACHE Server on my home machine and when It try the same code on that
machine, I get no response showing me the value of the $conn, but I do not
get any error message either). Confusing situation!

I do have the php_mysql.dll in the C:\php\ext folder

Well, none of this seem to matter. I am still getting the error listed
above using IIS .

Here is my setup:
I have MySQL 4.1.13a-nt installed. I am able to run MySQL Admin to add
users, add tables to the TEST DB, add records to the new table via the
command line as well as via the MySQL Query Browser. So I am pretty sure
that my MySQL is installed and working fine.)

I have the MySQL program installed on the default location "C:\Program
Files\MySQL\MySQL Server 4.1" as oppose to changing it to c:\MySQL folder
during the installation. I am hoping that this is not the reason for this
problem, but I am not sure.

I am able to run other non-MySQL related simple PHP code via my browser
just fine.
(Example:
<html>
<?php echo '<p>Hello World</p>'; ?>
and a few other simlar stuff. That all works fine.

But when I use the
<?php
$conn = mysql_connect("loca­lhost", "joeuser", "somepass");
echo $conn;
?>
code it just does not want to work. I get the "Fatal error: Call to
undefined function mysql_connect() in c:\Inetpub\wwwroot\­mysqlconnect.php
on line 2" error.

Any help would be greatly appreciated.

Regards,
Tony Aldemir



--
MySQL Windows Mailing List
For list archives: http://lists.mysql.­com/win32
To unsubscribe: http://lists.mysql.­com/win32?unsub=gcdm­w-win32@m.gmane.org


Add comment
Daniel da Veiga 26 August 2005 00:19:33 permanent link ]
 On 8/25/05, Tony_Aldemir@edward­s.com <Tony_Aldemir@edwar­ds.com> wrote:> Hello There,>
I am getting the "Fatal error: Call to undefined function mysql_connect()> in c:\Inetpub\wwwroot\­mysqlconnect.php on line 2" error when I try to> connect to the MySQL DB using:> <?php> $conn = mysql_connect("loca­lhost", "joeuser", "somepass");> echo $conn;> ?>>
I have made sure that my PHP.INI file is adjusted to reflect the following:

You can always use the phpinfo() function to generate a page with all
the information about the php installation, maybe your php isn't
configured correctly. Check for the mysql section and see if its all
working...
Uncommented the line "extension=php_mysq­l.dll" exposing this DLL to PHP.> I added the following line> extension_dir = "c:\php\ext">
I copied the libmySQL.dll to the c:\inetpub\wwwroot folder (I am using the> IIS on this machine, but I have the same configuration using the latest> APACHE Server on my home machine and when It try the same code on that> machine, I get no response showing me the value of the $conn, but I do not> get any error message either). Confusing situation!

I know nothing about IIS, so, I can't help you there. But you see,
$conn is an object, so, it can't be "echoed", I get "Resource id #3"
from the echo.
I do have the php_mysql.dll in the C:\php\ext folder>
Well, none of this seem to matter. I am still getting the error listed> above using IIS .>
Here is my setup:> I have MySQL 4.1.13a-nt installed. I am able to run MySQL Admin to add> users, add tables to the TEST DB, add records to the new table via the> command line as well as via the MySQL Query Browser. So I am pretty sure> that my MySQL is installed and working fine.)>
I have the MySQL program installed on the default location "C:\Program> Files\MySQL\MySQL Server 4.1" as oppose to changing it to c:\MySQL folder> during the installation. I am hoping that this is not the reason for this> problem, but I am not sure.>
I am able to run other non-MySQL related simple PHP code via my browser> just fine.> (Example:> <html>> <?php echo '<p>Hello World</p>'; ?>> and a few other simlar stuff. That all works fine.>
But when I use the> <?php> $conn = mysql_connect("loca­lhost", "joeuser", "somepass");> echo $conn;> ?>> code it just does not want to work. I get the "Fatal error: Call to> undefined function mysql_connect() in c:\Inetpub\wwwroot\­mysqlconnect.php> on line 2" error.>
Any help would be greatly appreciated.>
Regards,> Tony Aldemir>

It's clearly a problem with PHP that's not recognizing the MySQL
extension... I don't see why this is happening, since PHP should be
compiled with mysql support... Anyway, try the phpinfo() and see what
it says about mysql...

--
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.­com/win32
To unsubscribe: http://lists.mysql.­com/win32?unsub=gcdm­w-win32@m.gmane.org


Add comment
Guest 19 May 2007 14:55:47 permanent link ]
 I have the same problem as mentioned above, and every thing is configured correctly but still the same error -->please help me!
Add comment
balesh 19 May 2008 04:58:58 permanent link ]
 can anybody help
fatel error : unable to connect()



<?
mysql_connect("loca­lhost" ,"root","");
$conn= mysql_connect("loca­lhost" ,"root","");
mysql_select_db("sy­mlaw");
error_reporting(1);­

Add comment
Guest 23 August 2008 01:58:51 permanent link ]
 I had the same problem with the following setup:
PC with Windows XP Pro SP3
IIS
MySQL 5.0
PHP 5.2.6
It turned out that with PHP 5+ the extension used is MySQLi and I had to use mysqli_connect() instead of mysql_connect(). As soon as I changed the function name, it worked.
Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
respect your talk pals, avoid using obscene language, typing entire messages in CAPS, posting buy/sell ads or violating netiquette or the RF Criminal Code..


QAIX > MySQL database development > Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\­mysqlconnect.php on l 29 January 2009 00:36:45

see also:
Webmail friendly navigation
Articles not being published
Collapsabe lists
pass tests:
see also:
The most known WebOS-es
Me, me and again me...

  Copyright © 2001—2009 QAIX
Idea: Miñhael Monashev
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .