Re: MySQL result resource
| From: | Edwin Boersma | Date: | Sat, 01 Feb 2003 16:50:04 +0000 |
| Subject: | Re: MySQL result resource | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25319@lists.php.net to get a copy of this message | ||
Agree fully....
Try this:
$query = "select * from category where id=$scrow->category";
$result = mysql_query($query) or die( mysql_error() );
If your query fails, and u still can't find the reason from the information that mysql_error() give you, put a "echo $query" inbetween to see which string your passing to mysql_query().
Edwin
John W. Holmes wrote:
It means your query failed... it always means your query failed for some reason (unless you typo a variable name...). Learn to use mysql_error() in conjunction with mysql_query(). Also, like I said before, mysql_db_query() is depreciated, you should be using mysql_query(). ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/-----Original Message----- From: Addison Ellis [mailto:addison@bellsouth.net] Sent: Wednesday, January 29, 2003 10:02 PM To: php-db@lists.php.net Subject: [PHP-DB] MySQL result resource hello, i have a new issue... :-) i am getting: Warning: Supplied argument is not a valid MySQL result resource in /users/infoserv/web/register/ca/admin/catads.php on line 54 from: <?addisonwhile($row = mysql_fetch_object($obj)) { $scobj = mysql_db_query($dbname,"select * from subcategorywhere id=$row->subcategory");$scrow = mysql_fetch_object($scobj); $cobj = mysql_db_query($dbname,"select * from category whereid=$scrow->category");//54$crow = mysql_fetch_object($cobj);?> any ideas, of course, are most appreciated. thank you and best,-- Addison Ellis small independent publishing co. 114 B 29th Avenue North Nashville, TN 37203 (615) 321-1791 addison@bellsouth.net info@smipco.com subsidiaries of small independent publishing co. info@gloabaldog.com info@momandpocentral.com