I’m creating a very simple ticket system for one of my sites and I’m a little stuck. Basically I have most of it completed but I’m stuck on the permissions part.
I want to display tickets submitted by a user only to that user and I want to display any admin replies as well.
$dbQuery = "SELECT * FROM $mytable WHERE ticketID='$ticketID' AND internalKey='$userID' ";
$result = mysql_query($dbQuery) or die( mysql_error() );
while ($row = mysql_fetch_array($result)) {
extract($row);
$ticketnameAlt = $row['ticketname'];
if ($_SESSION['webInternalKey'] == $userID){
echo $ticketname;
}
}
This is simplified from what I have but you can see that the results will show tickets from a userID which is taken from the SESSION. That works fine but how do I include any replies from an admin’s userID as well? I searched for info on multiple WHERE clauses but that didn’t give me any helpful info on what I’m trying to achieve.