I have a dynamic ul list from a database being outputted as categories however there is one category I don’t want listed in this particular list. Is there a sql select that stops from showing one value in the field? or can I write an if statement after the select query that targets the list to not show that one item?
If anyone can help then I’d greatly appreciate it!
I have a dynamic ul list from a database being outputted as categories however
Share
SQL provides
whereclauses for you to filter the results you’re selecting.Assuming your table is called
categoryand its primary key isid, add something along the lines ofwhere category.id != <id of category you don't want>to your query. If you already have awhereclause, append another condition withandinstead:and category.id != ....