This is the query for SQL statement
UPDATE TrendingEvents
SET Name = ?, Image = ?, Date = ?, EventCategory = ?
WHERE ID = ?;')
I would like to access the ID of the other table within my TrendingEvents table. This is the example I've done although it doesn't fully work;
UPDATE TrendingEvents INNER JOIN
Events AS eID
ON TrendingEvents.ID = Events.ID
SET Name = ?, Image = ?, Date = ?, EventCategory = ?
WHERE eID = ?;')
I would like to update the TrendingEvents table with the ID column from Events table.
The error I'm getting from my statement is
Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'Name'
Which just shows that I've poorly designed my query.