The query works just fine like:
$query = '(SELECT contenttype, id, title, type, image, rating, date2, num_votes FROM videos)
UNION
(SELECT contenttype, id, title, type, image, rating, date2, num_votes FROM games)
UNION
(SELECT contenttype, id, title, type, image, rating, date2, num_votes FROM pics)
ORDER BY date2 DESC
LIMIT 10';
$r = mysql_query($query) or die(mysql_error());
but WILL NOT work if I try to pull the column, on. All of the tables in the database use a column named on. I get this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on, type, image, rating, date2, num_votes FROM videos) UNION (SELECT contentty' at line 1
example of me adding on to me query:
$query = '(SELECT contenttype, id, title, type, on, image, rating, date2, num_votes FROM videos)
UNION
(SELECT contenttype, id, title, type, on, image, rating, date2, num_votes FROM games)
UNION
(SELECT contenttype, id, title, type, on, image, rating, date2, num_votes FROM pics)
ORDER BY date2 DESC
LIMIT 10';
$r = mysql_query($query) or die(mysql_error());
Doesn't make sense to me. Why would this occur?