php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6698 Resource id #1 on $mysql_link
Submitted: 2000-09-12 21:55 UTC Modified: 2000-09-13 06:49 UTC
From: domisse at terravirtual dot net Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.2 OS: Linux 2.2.15
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: domisse at terravirtual dot net
New email:
PHP Version: OS:

 

 [2000-09-12 21:55 UTC] domisse at terravirtual dot net
I'm trying to check if my MySQL connection work with :

$mysql_link = mysql_connect("195.154.245.142","root","");

print "$mysql_link\n";

Documentation says that $mysql_link should be a int but
i get an "Resource id #1" whatever the connexion is
made or not.
I need to test if i could access MYSql successfuly.
I've seen the bug closed in 4.0.1 but I have still
the problem with 4.0.2

Thanks
Laurent


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-13 06:49 UTC] sniper@php.net
You can check if connection was established like this:

$mysql_link = mysql_connect("195.154.245.142","root","");
if(!$mysql_link) {
    die("ERROR: No connection!");
}

Documentation says: 

Returns a positive MySQL link identifier on success, or an error message on failure. 

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Oct 14 02:00:01 2026 UTC