mysql: using comma-separated values I have a simple mysql table which I use as a server booking system. A user can log in to a server, if he has a valid booking for that server. A sample data might look like this:

+----------+----------------+---------------------+---------------------+
| server   | user           | start               | end                 |
+----------+----------------+---------------------+---------------------+
| server01 | Alice,Bob      | 2013-10-28 00:00:00 | 2013-12-31 00:00:00 |
| server02 | Carlos         | 2013-10-28 00:00:00 | 2013-12-31 00:00:00 |
| server03 | Dan,Erin,Frank | 2013-10-28 00:00:00 | 2013-12-31 00:00:00 |
+----------+----------------+---------------------+---------------------+


To check whether user Carlos has a booking for server02, I use the following SQL query:

SELECT 0, id FROM booking WHERE user = 'Carlos'
AND (( start &lt; now() and end &gt; now() ) AND server = 'server02') ;


But this query does not work if there are multiple (comma-separated) users. How can I check if Alice has booking for server01 ?
I would overthink your design and would change to something like this:

Usertable

+--------+----------+
| UserID | Username |
+--------+----------+
|    1   |   PAUL   |
+--------+----------+
|    2   |   Eric   |
+--------+----------+


Servertable

+------------+------------------+
|  ServerID  |    Servername    |
+------------+------------------+
|     1      |      Apache      |
+------------+------------------+
|     2      |      Nginx       |
+------------+------------------+


Serverbooking

+-------------+-----------------+---------------+-------------+
|   ServerID  |     UserID      |      Start    |     End     |
+-------------+-----------------+---------------+-------------+
|      1      |        1        |   somedate    |   somedate  |
+-------------+-----------------+---------------+-------------+
|      2      |        1        |   somedate    |   somedate  |
+-------------+-----------------+---------------+-------------+
|      1      |        2        |   somedate    |   somedate  |
+-------------+-----------------+---------------+-------------+