php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2051 mysql_error() is not returning anything.
Submitted: 1999-08-13 19:56 UTC Modified: 1999-08-14 05:33 UTC
From: joelg at naples dot net Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0 Beta 2 OS: Linux 2.2.10 libc5
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joelg at naples dot net
New email:
PHP Version: OS:

 

 [1999-08-13 19:56 UTC] joelg at naples dot net
In php3 I was able to call the mysql_error() whenever there was a mysql specific error (IE: If the script was not able to conect to the server it would display info about it), but it seems everytime the mysql_error() function is called under php4b2 it simply returns a NULL string. I've tested it under conditions where the mysql server is down, and the page displays the warning message cgenerated by php3's warning facility, but if I try to echo mysql_error() I retrieve nothing back. Could anyone tell me why this is, and if it's a big could you please notify me so I can be sure it's not just some stupid mistake on my part :)

************* MODULES COMPILED IN ************
mysql
gd1.3
zlib
ttf

************ SHORT SCRIPT *****************
$conn = mysql_connect("localhost","user","pass); // Server that is currently down.
if(!$conn) {
    echo mysql_error();
    exit;
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-08-14 05:33 UTC] zeev at cvs dot php dot net
mysql_error() never has and doesn't return error information for
failed connects.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 06 15:01:35 2025 UTC