Bug #10983 Updated: php can't select database in mysql, so mysql is not working at all.
| From: | rasmus@php.net | Date: | Mon, 21 May 2001 05:38:06 +0000 |
| Subject: | Bug #10983 Updated: php can't select database in mysql, so mysql is not working at all. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-56004@lists.php.net to get a copy of this message | ||
ID: 10983
Updated by: rasmus
Reported By: kim@dns.clickbiz.com.tw
Status: Closed
Bug Type: MySQL related
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
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().
Previous Comments:
---------------------------------------------------------------------------
[2001-05-21 07:27:06] kim@dns.clickbiz.com.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:wwwtestphpdb.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 06:02:59] 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 05:16:49] kim@dns.clickbiz.com.tw
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10983&edit=2