Pusey Collection > By Title >
$connection = @mysql_connect("dbhost","adminsql","sizy4mot") or die (mysql_error()); $db = @mysql_select_db(talbot_pusey,$connection) or die(mysql_error()); $query = "select id, title from title where title like '$alpha%' order by title"; $result = mysql_query($query) or die("Error: " . mysql_error()); while ($row = mysql_fetch_array($result)) { $title = $row["title"]; $id = $row["id"]; $sql = "select count(id) as counter from image where tid = $id"; $sql_result = mysql_query($sql) or die("Error: " . mysql_error()); while ($row2 = mysql_fetch_array($sql_result)) { $count = $row2["counter"]; } ?>"> echo "$title";?> if ($count > 1) {echo " (with $count views)";}?>
} ?>