Re: MySQL result resource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:  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:
<?
    while($row = mysql_fetch_object($obj))
        {
      $scobj = mysql_db_query($dbname,"select * from subcategory
where id=$row->subcategory");
      $scrow = mysql_fetch_object($scobj);
      $cobj = mysql_db_query($dbname,"select * from category where
id=$scrow->category");//54
      $crow = mysql_fetch_object($cobj);
?>


any ideas, of course, are most appreciated. thank you and best,
addison

--
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



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux