function show_books($cid, $host, $php_self) { $q = "select * from books where category = '".$cid."'"; $r = mysql_query($q) or die(mysql_error()); echo ''; while ($book=mysql_fetch_array($r)) { echo ''; } echo '
'.$book['title'].''.$book['title'].'
'; }