I have a problem with data in MySQL. I have a column "vacation_period" where I keep data with dates separated by commas eg. "02/10/2015,02/11/2015" and I want to explode commas, month and year. I want to make condition where I can compare month and year sent by POST with exploded data from MySQL field.
Example query:
SELECT *
FROM ag_vacations INNER JOIN
ag_employees
ON ag_vacations.user_id = ag_employees.e_id
where ag_vacations.user_id = 1 AND
ag_vacations.vacation_period = 2015 AND
ag_vacations.vacation_period = 02
order by date_added desc
vacation_perdiodwith a comma-delimited list of dates. You should instead have a separate table, called a junction table, with one row per whatever (employee ?) and vacation date. The date should be stored in the database as a proper date and not as a string.