Is it possible to make a selection from a selection using SQL tools? For example, the selection of all messages from the database:
$query = "SELECT * FROM table WHERE id='$id'"; $result= mysql_query($query);
Now in $ resoure - all messages. We display their number. Now it is necessary to select the records with the specified value of the 'is_read' field. Can I somehow use the previous result, or will have to do another sample (for the same data !!):
$query = "SELECT * FROM table WHERE id='$id' AND is_read='not_read'"