需要php代码从数据库中选择's大于5但不大于15(意味着所有大于5的数字,不包括15)


Need php code for a selection from database that's greater than 5 but not 15 (meaning all numbers higher than 5 not including 15)?

代码如下:

$q = "SELECT * FROM `groups` WHERE `id`>5 ORDER BY `name` ASC";
$results = mysql_query($q);

我的问题是,我可以调整'id'>5为

有没有办法重写上面的$q行使之成为可能?

在WHERE子句中添加另一个条件

SELECT *
FROM `groups`
WHERE
  `id` > 5
  AND `id` <> 15
ORDER BY `name` ASC