SQL Query Help

wxdqz

New Member
Hello

I am, what should be, a simple SQL query question, only I can't seem to figure it out.

I have a TABLE

(here is my sql dump)
CREATE TABLE posts (
id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
signdatetime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
ip varchar(55) NOT NULL,
name varchar(50) NOT NULL,
email varchar(50) NOT NULL,
admin_only varchar(3) NOT NULL,
comments text NOT NULL,
PRIMARY KEY (id)
);


I have to PHP pages:

view.php
view_admin.php


When people "Post" a submission, they have the option of selection whether the message should be viewed only by the ADMIN of the web site.

I need a method to be able to have all the POSTS display on the [view.php] page *EXCEPT* those with the "admin_only" option NOT selected.

Then I need a method to be able to have all the POSTS display on the [view_admin.php] page *INCLUDING* those with the "admin_only" option *selected*.

Any ideas?
 
Back
Top