Saya sedang bekerja sehingga tidak dapat menguji atau mengompilasinya, tetapi saya harap logika saya dapat dimengerti.
Tidak yakin apakah ini akan berhasil tetapi sesuatu seperti ini
$book_price_array = array(); //contents to be added.
// loop through the array an examine its price by querying your table.
foreach ($book_id_array as $key => $value) {
$price = mysql_query("SELECT price FROM table_bookPrice
WHERE book_id = {$value}");
// there is a price, set the price.
if ($price > 0 && $price != NULL) $book_price_array[$key] = $price;
// there is no price, set the default price
else $book_price_array[$key] = 500;
}