query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi to all,
I'm working in a system where users can post projects. Other users will
verify those projects. What I'm trying to do is once a user verify a project
he/she cannot view it anymore, but I want to keep it available for the other
users that haven't verified it.

I have two tables project and user_verified. On project table I keep all the
projects that users post.
On user_verified I keep users who already verified for a project.

These are the fields for user_vefified table

project_id, username, verified

Everytime a user verifies a project I insert a new record to the
user_verified table.

This the query, but it doesn't work.
It selects the same record from the two tables. e.g. if the records exist
twice on the user_verified table and one on the project table, it will
display three records when I run the the following query:

$sql = "SELECT project.project_id, project.project_name,
project.project_desc FROM project, user_verified
       WHERE project.username <> user_verified.username AND project.username
<> '$PHP_AUTH_USER' AND project.category='$category')";

any help is greatly apprecciate it

Thanks in advance
Nato


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux