php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3724 mysql_connect() return value ?(Integer):(MySQL Resource ID)
Submitted: 2000-03-03 23:26 UTC Modified: 2000-03-04 20:55 UTC
From: ahsiu at ahsiu dot xfiles dot to Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0 Beta 4 Patch Level 1 OS: FreeBSD 3.3 Release
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: ahsiu at ahsiu dot xfiles dot to
New email:
PHP Version: OS:

 

 [2000-03-03 23:26 UTC] ahsiu at ahsiu dot xfiles dot to
The following is part of my PHP code
<?php

$linkid=mysql_connect("mysite.domain","name","passwd");
echo "link id: ".$linkid."<br>";     
if($linkid==false){
    echo "failed to connect to database";
    exit();
}
?>

The Result is:

link id: Resource id #1
failed to connect to database.

Why $linkid echos "Resource id #1" and is also equal to
false value ??
I've checked the manual to see what type the 
mysql_connect() returns and it's "int".

What exactly the type of returned type of mysql_connect()
is ??

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-03-04 20:52 UTC] ahsiu at ahsiu dot xfiles dot to
The following is part of my PHP code
<?php
$linkid=mysql_connect("mysite.domain","name","passwd");
echo $linkid."<br>";
$linkid=(int)$linkid;                    
echo $linkid."<br>";
?>

The Result is:

Resource id #1
1

What exactly the type of returned type of mysql_connect()
is ??
(prototype of mysql_connect: int mysql_connect(...) )

 [2000-03-04 20:53 UTC] ahsiu at ahsiu dot xfiles dot to
The following is part of my PHP code
<?php
$linkid=mysql_connect("mysite.domain","name","passwd");
echo $linkid."<br>";
$linkid=(int)$linkid;                    
echo $linkid."<br>";
?>

The Result is:

Resource id #1
1

What exactly the type of returned type of mysql_connect()
is ??
(prototype of mysql_connect: int mysql_connect(...) )

 [2000-03-04 20:53 UTC] ahsiu at ahsiu dot xfiles dot to
The following is part of my PHP code
<?php
$linkid=mysql_connect("mysite.domain","name","passwd");
echo $linkid."<br>";
$linkid=(int)$linkid;                    
echo $linkid."<br>";
?>

The Result is:

Resource id #1
1

What exactly the type of returned type of mysql_connect()
is ??
(prototype of mysql_connect: int mysql_connect(...) )

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sun Oct 11 06:00:01 2026 UTC