socalnate Posted November 18, 2007 Share Posted November 18, 2007 I can't figure out why SQL is telling me why this table doesn't exist when it clearly DOES exist in my database. Any ideas? Something wrong with my SQL query? Nathan __________ Error SQL query: Documentation SELECT eg_titles. * , eg_genres.id, eg_gameplay_history.title_id, eg_gameplay_history.played, eg_gameplay_history.play_date, COUNT( eg_gameplay_history.played ) AS 'title_count' FROM eg_titles LEFT JOIN eg_genres ON eg_titles.id = eg_genres.title_id WHERE eg_genres.genre = 'action' AND eg_titles.id = eg_gameplay_history.title_id AND eg_gameplay_history.play_date BETWEEN DATE_SUB( CURDATE( ) , INTERVAL 3 DAY ) AND CURDATE( ) GROUP BY eg_gameplay_history.title_id ORDER BY title_count DESC LIMIT 10 MySQL said: Documentation #1109 - Unknown table 'eg_gameplay_history' in field list Quote Link to comment https://forums.phpfreaks.com/topic/77775-sql-tells-me-table-doesnt-exist-when-it-does/ Share on other sites More sharing options...
Barand Posted November 18, 2007 Share Posted November 18, 2007 My moneys on a problem with the chair-keyboard interface rather than a bug in MySQL. eg_gameplay_history isn't in your FROM clause. Quote Link to comment https://forums.phpfreaks.com/topic/77775-sql-tells-me-table-doesnt-exist-when-it-does/#findComment-393700 Share on other sites More sharing options...
socalnate Posted November 18, 2007 Author Share Posted November 18, 2007 Thanks, This query worked! The only issue I'm having is that it is very slow...3.0645 seconds! :'( Any suggestions? SELECT eg_titles. * , eg_genres.id, eg_gameplay_history.title_id, eg_gameplay_history.played, eg_gameplay_history.play_date, COUNT( eg_gameplay_history.played ) AS 'title_count'FROM eg_titles, eg_gameplay_history LEFT JOIN eg_genres ON eg_titles.id = eg_genres.id WHERE eg_genres.genre = 'action' AND eg_titles.id = eg_gameplay_history.title_id AND eg_gameplay_history.play_date BETWEEN DATE_SUB( CURDATE( ) , INTERVAL 3 DAY ) AND CURDATE( ) GROUP BY eg_gameplay_history.title_id ORDER BY title_count DESC LIMIT 10 Quote Link to comment https://forums.phpfreaks.com/topic/77775-sql-tells-me-table-doesnt-exist-when-it-does/#findComment-393719 Share on other sites More sharing options...
socalnate Posted November 18, 2007 Author Share Posted November 18, 2007 Yeah I don't understand why I have to include FROM eg_gameplay_history in my query. I guess it has something to do with the COUNT? Quote Link to comment https://forums.phpfreaks.com/topic/77775-sql-tells-me-table-doesnt-exist-when-it-does/#findComment-393721 Share on other sites More sharing options...
Barand Posted November 18, 2007 Share Posted November 18, 2007 Basic SQL syntax SELECT these columns FROM these tables Quote Link to comment https://forums.phpfreaks.com/topic/77775-sql-tells-me-table-doesnt-exist-when-it-does/#findComment-393817 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.