I have a list of events and I would like to find duplicates for upcoming events. Since the same event can have several different event titles, I think the safest bet here is to look for events that happen in the same venue same day and remove duplicates manually from there.
Similar question was asked here.
$todays_date = date('Y-m-d');
$sql="
SELECT place_name, event_title, start_date, count(*)
FROM main WHERE start_date >= '$todays_date'
GROUP BY start_date, place_name HAVING count(*) > 1";
$result = mysql_query($sql);
//display events
while ($row = mysql_fetch_array($result))
{
echo $row['place_name'] . "- ";
echo $row['event_title'] . "- ";
echo $row['start_date'] . "<br/>";
}
This does not give me an expected result at all, in fact, I have no idea how this recordset is assembled.
Venue - Event Name - Date
Rotary Centre for the Arts- Leela Gilday - 2017-03-10
Rotary Centre for the Arts- Joe Trio - 2017-03-21
Vernon and District Performing Arts Center- Shay Keubler's GLORY- 2017-04-01
Vernon and District Performing Arts Center- A Midsummer Night's Dream- 2017-04-30
Vernon and District Performing Arts Centre- Canadiana Suite - 2017-05-06
Kelowna Community Theatre - Glenn Miller Orchestra- 2017-06-27
Any tips are much appreciated.
I tried it without the date, and just grouping by event_title and place_name, with a similar strange output where the only duplicates are those of the venue names (place_name).