Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 MySQL 表,其中包含我想要的类别和子类别
类别是销售,子类别是英语,再次像这样有销售和子类别中文的记录,所以有 4 个类别的子类别,所以我希望它应该从表中选择类别,但如果类别有 4 条记录销售在选择类别时,它只显示为 1 的类别。
$query = mysql_query("SELECT * category FROM catalog_Master");
然后查询将是
$query = mysql_query("SELECT DISTINCT(category) FROM catalog_Master");