Only display a specific category from a database using php/mysql
hi everyone :)
i know how to show all the records from database in an html table but how would i show specific category.for example i want to show records only with type T (type T is in database).im new with php and i dont know how to do it properly.thankyou here is my code
In MySQL queries, you only use one = char to compare values, not two.
SELECT ... WHERE type = 'T'
Also, you should always check database results before trying to use them. That way, errors like the one above will be much easier to debug. For example:
And, while I'm already at it, the mysql_query family of functions - the old MySQL API extension - is deprecated and really shouldn't be used. Instead use PDO or MySQLi.