Query Cookie within MySQL?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Query Cookie within MySQL?

Post by simonmlewis »

$result = mysql_query ("SELECT DISTINCT website FROM support WHERE dateactioned is NULL AND controller = '$cookiewebsite' OR $cookiewebsite = 'ADMIN' AND user = 'yes' ORDER BY website ASC");
This errors. I need to query to see who controls the entry in the database, but to override it if the logged in person is an ADMIN person.

I thought this script would say to select from the table where the Controller is "website name" OR the cookie's web site states "ADMIN".

Can you not query a cookie within a query like this?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply