php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6257 mysql function returns 'Resource id #'
Submitted: 2000-08-20 04:05 UTC Modified: 2000-08-20 04:24 UTC
From: axel at asta dot uni-hamb Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.1pl2 OS: Redhat 6.2 Linux 2.2.16
Private report: No CVE-ID: None
 [2000-08-20 04:05 UTC] axel at asta dot uni-hamb
When trying to connect to a db with php4, the result is 'Resource id #1' (and #2 etc. on subsequent calls) instead of an integer.

The call was:
echo mysql_connect("localhost",$wwwuser,$wwwpass)
Changing any fields dos not help at all (I think I tried every possible variant during the last 12 hours). mysql_pconnect produces the same error, btw.

*The problem is eliminated by switching back to php3!*

I installed the latest mysql from source and from rpm, it did not help. However, I saw similar problems when searching dejanews.com, but related to other mysql calls. Obviously, other people are at least able to connect to a database before the problem arises.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-20 04:24 UTC] sniper@php.net
I don't really understand what is the problem? 
Of course it echoes "Resource id #1" when you echo it. It should be stored in a variable
which is then used with the other mysql-functions.

See http://www.php.net/manual/function.mysql-connect.php for example how to use it.

--Jani
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 20:00:02 2026 UTC