|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-02-04 05:41 UTC] mark-junk at domino dot com
$conn = mysql_connect();
mysql_select_db("test"); // this database exists and can be opened using mysql interactively
$result = mysql_query("select * from mysql_auth"); // this query works interactively
echo "result=$result<BR>"; // echoes "result=<BR>"
echo(mysql_error()); // echoes nothing
while($row = mysql_fetch_object($result)) { // gives a warning : 0 is not a MySQL result index in /export/htdocs/mark/extranet/users.php3 on line 15
*** THIS IS NOW RESOLVED:
The PHP-MySql conflicts with the mod_auth_mysql module in apache - if you compile one or both of them
as shared objects (i.e. DLLs), then this fixes the problem.
I'm running PHP as a shared object now and it all works. Mark
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 08:00:01 2025 UTC |
First, check the return value from *every* MySQL function call you make. From your file it's not clear at all where PHP fails. The only that's obvious is that the mysql_query() call fails. The fact that mysql_error() returns nothing also implies that mysql_connect() failed right from the beginning. The bottom line is that mod_auth_mysql doesn't affect PHP's behavior in any way, whether it's compiled into the server or dynamically loaded. Your problem is most probably unrelated, as Rasmus said, there's a good chance your mysql_connect() fails because of an invalid username (never rely on the runtime username, unless you *really* know what you're doing and perfectly understand the difference between uid's, euid's, and the way MySQL uses them to determine the current default username; You're much better off explicitly supplying the username and password). Start with a simple script, something like: <? error_report(E_ALL); if (!mysql_connect($username)) { print "mysql_connect() failed\n"; } ?> That would probably give us all the clues we need.