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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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: Sat Oct 10 22:00:02 2026 UTC