forum.coppermine-gallery.net
Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: hama on June 08, 2005, 12:37:09 am
-
I count the pics of the gallery and display the number on the startpage of my website. It works fine with this short script:
<?php
// new Gallery DB
$_gallery = new db($_cfg['DB_SERVER'], $_cfg['DB_GALLERY_USER'], $_cfg['DB_GALLERY_PASS'], $_cfg['DB_GALLERY_NAME']);
// gallery_pics
$gallery_pics = implode('', $_gallery->fetch_first('SELECT COUNT(*) FROM cpg130_pictures AS p, cpg130_albums AS a WHERE p.aid = a.aid AND a.category <> 9'));
?>
As you see I exclude cat 9 (it's a private album and I don't want to count it).
Now I'd like to exclude two cats but 9,43 gives "bad arguments", 9 AND 43 gives no errors but counts wrong.
Can someone help please. ;)
... Thanks
-
...AND a.category NOT IN ( 9, 43)
-
Yes, it works!
<?php
$gallery_pics = implode('', $_gallery->fetch_first('SELECT COUNT(*) FROM cpg130_pictures AS p, cpg130_albums AS a WHERE p.aid = a.aid AND a.category NOT IN ( 9, 43)'));
?>
Thanks a lot! :D
--> "Lé Toph' de Tieum - NYC ou pas NYC...that is the question" --> nice gallery! 8)
-
--> solved
-
nice