php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10983 php can't select database in mysql, so mysql is not working at all.
Submitted: 2001-05-21 05:16 UTC Modified: 2001-05-21 07:38 UTC
From: kim at dns dot clickbiz dot com dot tw Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.5 OS: WINNT 4.0
Private report: No CVE-ID: None

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-21 06:02 UTC] cardinal@php.net
Please read the bug submission guidelines.

http://www.php.net/bugs-dos-and-donts.php

This report lacks any details, especially an example script or error message.  It's probably an issue with your script.  Reopen the report with an example script and error messages, or ask one of the support mailing lists for assistance.

http://www.php.net/support.php
 [2001-05-21 07:27 UTC] kim at dns dot clickbiz dot com dot tw
sorry, but i was too mad to notice.

let me rephrase the whole thing.

After i upgrade php from 4.04p1 to 4.05 at WinNT machine, i couldn't get mysql query working at all. Technically, they all work, just i don't get any result back.
example:
<?
 echo "DATABASE: Healthy<BR>";
 $query="select * from MEMBER";
 $ident = mysql_connect("Kim","root","")
                    or die("Bad query: ".mysql_error());
 mysql_select_db("healthy");
 $restult=mysql_db_query("healthy",$query);

 while ($row=mysql_fetch_array($result))
  echo $row["serial"];
?>

and the result i got is:

DATABASE: Healthy

Warning: Supplied argument is not a valid MySQL result resource in d:\www\test\php\db.php on line 13
 
i can assure you that the member table is not empty. 
i have tried re-install php and apache, but they still don't work as they should.

 [2001-05-21 07:38 UTC] rasmus@php.net
You need to check for errors on your mysql_db_query().  Your "or die(mysql_error()) belongs there.  And since you have already done a mysql_select_db(), you can just use mysql_query().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC