开发者

Warning: mysql_query() [function.mysql-query]: Unable to save result set in [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the in开发者_如何学Pythonternet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

Here are my errors:

Warning: mysql_query() [function.mysql-query]: Unable to save result set in D:\Users\avinash\liveprojects\WordPressDemo\wp-admin\export.php on line 31

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in D:\Users\avinash\liveprojects\WordPressDemo\wp-admin\export.php on line 54

my query working fine in phpmyadmin.

but its not running with PHP.

I have repaired the tables, optimized the tables, used mysql_query("SET SQL_BIG_TABLES=1");

But nothing seems to be working.

Any suggestion?

Query :

$sql ="select p.id,p.name,p.slug,p.summary,p.description,IF(p.published='on','Y','N') as published, (SELECT c.name FROM wp_shopp_category c WHERE c.id=(SELECT cat.category FROM wp_shopp_catalog cat WHERE cat.product=p.id AND cat.category IN (SELECT c.id FROM wp_shopp_category c WHERE c.parent='13'))) as BrandName, (SELECT GROUP_CONCAT(cat.category) FROM wp_shopp_catalog cat WHERE cat.product=p.id AND cat.category NOT IN (SELECT c.id FROM wp_shopp_category c WHERE c.parent='13') AND cat.category<>13) as catName, (SELECT GROUP_CONCAT(src SEPARATOR ',') from wp_shopp_asset ast WHERE (ast.src='0' OR ast.src=ast.id) AND ast.parent=p.id AND ast.name LIKE 'thumbnail%'  ORDER BY ast.sortorder ASC) as images, price.price, (price.price - price.saleprice) as discount from wp_shopp_product p LEFT JOIN wp_shopp_price price on p.id=price.product WHERE price.optionkey='0'"; 


If this subquery:

SELECT cat.category FROM wp_shopp_catalog cat WHERE cat.product=p.id AND cat.category IN (SELECT c.id FROM wp_shopp_category c WHERE c.parent='13')

returns multiple results then you will get that error message. Perhaps it should be

c.id IN (SELECT ...)

or:

c.id=(SELECT ... LIMIT 1)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜