An error occurred!

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

#0 /home/www/www.agenturneubauer.com/data/application/model/Galleries.php(15): Database->query('SELECT g.id,\r\n ...')
#1 /home/www/www.agenturneubauer.com/data/application/controller/Artist.php(51): Model_Galleries->findByArtistAndCategory(NULL, 1)
#2 [internal function]: Controller_Artist->bioAction('sandra-seckinge...', 'photography')
#3 /home/www/www.agenturneubauer.com/data/application/system/system.php(179): call_user_func_array(Array, Array)
#4 /home/www/www.agenturneubauer.com/data/application/system/system.php(84): System->processUri()
#5 /home/www/www.agenturneubauer.com/data/index.php(15): System->run()
#6 {main}