Itay-
OK. Here's a snippet from the show latest images script I use:
$images = query_full_array("SELECT images.albumid, images.filename AS filename, images.title AS title, albums.folder AS folder FROM ".prefix('images')." AS images, ".prefix('albums')." AS albums WHERE images.albumid = albums.id AND images.show = 1 ORDER BY images.id DESC LIMIT $number");
Note the ".prefix('images')." section (quotes and periods are important!)
What you'll need to do is structure your query using the prefix('images') portion
OR
you can hardcode your query for your specific prefix. The DB prefix is what is prefaced before your database table reference, i.e. zen_images, zp_images. This varies per database.
I hope that helps.