An error occurred!

"error in sql query
SELECT, g.title, g.url FROM galleries AS g LEFT JOIN galleries_categories AS gc ON gc.galleries_id = WHERE g.artists_id = AND gc.categories_id = 1 ORDER BY g.sort,
1064: 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 'AND gc.categories_id = 1 ORDER BY g.sort,' at line 8"

#0 /home/www/ Database->query('SELECT,\r\n ...')
#1 /home/www/ Model_Galleries->findByArtistAndCategory(NULL, 1)
#2 [internal function]: Controller_Artist->bioAction('sandra-seckinge...', 'photography')
#3 /home/www/ call_user_func_array(Array, Array)
#4 /home/www/ System->processUri()
#5 /home/www/ System->run()
#6 {main}