Welcome Guest, Not a member yet? Register   Sign In
Selecting from database, question.
#1

[eluser]NateL[/eluser]
In a lot of applications, things that are user submitted are often held in a moderation queue.

It's displayed publicly when the status of the content has been set to 'Approved'

If I have a table in my database named "posts" with a column called "status", and I have various different statuses - Approved, Pending Approval, Rejected, etc....and I want to pull all of the contents that are "Approved", is it better to have each status represented as an integer?

In other words, is it OK to run a query like this:

Code:
SELECT * FROM posts WHERE status = 'approved';

Or, is it better to have the status represented as a number, like so:

1 - Approved
2 - Pending Approval
3 - Rejected

Code:
SELECT * FROM posts WHERE status = 1;

Thanks Smile


Messages In This Thread
Selecting from database, question. - by El Forum - 02-22-2010, 01:13 PM
Selecting from database, question. - by El Forum - 02-22-2010, 01:48 PM
Selecting from database, question. - by El Forum - 02-22-2010, 03:03 PM



Theme © iAndrew 2016 - Forum software by © MyBB