|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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 ??
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 17:00:01 2026 UTC |
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(...) )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(...) )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(...) )