PDA

View Full Version : How can i exclude a styleid from this?


N9ne
01-15-2003, 07:53 PM
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 GROUP BY user.styleid");
$dropdownbits='';
while ($thisstyle=$DB_site->fetch_array($allstyles)) {
if ($styleid==$thisstyle[styleid]) {
$stylesel='selected';
} else {
$stylesel='';
}
eval("\$dropdownbits .= \"".gettemplate('forumhome_dropdownbit')."\";");
}

I want to make it so styleid=X is not shown in the menu, no point posting in the appropriate thread as firefly is far too busy to reply and normally no one replies...it's just a quick question for someone with experience in PHP/SQL.

Xenon
01-15-2003, 10:10 PM
$allstyles=$DB_site->query("SELECT style.title, user.styleid, COUNT(*) AS count FROM user LEFT JOIN style USING (styleid) WHERE style.styleid IS NOT NULL AND style.userselect=1 AND style.styleid<>X GROUP BY user.styleid");

Dean C
01-16-2003, 03:18 PM
SO is the <> sign in sql the equivalent of != in PHP?

- miSt

Xenon
01-16-2003, 04:36 PM
<> and != is equivalent in php and in sql, so you can also use <> in php and also != in sql :)

Dean C
01-16-2003, 05:31 PM
Oh i see - that's quite cool then *one to remember* ;)

Thanks

- miSt

N9ne
01-16-2003, 06:41 PM
Thanks Xenon!

Xenon
01-16-2003, 06:46 PM
you're both welcome :)