Hello there!

I have a question - I'm trying to display store categories (ex: Apparel and Accessories) in this code. The categories display perfectly, but when I click on said categories, they do not display the items underneath it. I've populated the database with a few values, but they still do not display.

//this is a script to view categories
//connect to database
$mysqli = mysqli_connect("localhost", "meh", "blah", "hello");

$display_block = "<h1>My Categories</h1>
<p>Select a category to see its items.</p>";

//show categories first
$get_cats_sql = "SELECT id, cat_title, cat_desc FROM product_categories ORDER BY cat_title";

$get_cats_res = mysqli_query($mysqli, $get_cats_sql) or die(mysqli_error($mysqli));

if(mysqli_num_rows($get_cats_res) < 1) {
    $display_block = "<p><em>Sorry, no categories to browse.</em></p>";

else {
    while ($cats = mysqli_fetch_array($get_cats_res)) {
        $cat_id = $cats['id'];
        $cat_title = strtoupper(stripslashes($cats['cat_title']));
        $cat_desc = stripslashes($cats['cat_desc']);

        $display_block .= "<p><strong><a href=\"".$_SERVER["PHP_SELF"]. 
        "?cat_id =".$cat_id."\">".$cat_title."</a></strong><br/>"

        if (isset($_GET["cat_id"])) {
            if ($_GET["cat_id"] == $cat_id) {
            //get items
            $get_products_sql = "SELECT product_num, product_name, price, cat_id FROM product_info
                      WHERE cat_id = '".$cat_id."' 
                      ORDER BY product_name";
            $get_products_res = mysqli_query($mysqli, $get_products_sql)
                     or die(mysqli_error($mysqli));

            if (mysqli_num_rows($get_products_res) < 1) {
                $display_block = "<p><em>Sorry, no products in this category.</em></p>";
            } else {
                $display_block .= "<ul>";
                while ($products = mysqli_fetch_array($get_products_res)) { 
                    $product_num = $products['product_num'];
                    $product_name = stripslashes($products['product_name']);
                    $product_price = $products['price'];

                    $display_block .= "<li><a href=\"viewitem.php?
                    </strong> (\$".$product_price.")</li>";

                $display_block .= "</ul>";
            //free results
//free results

//close connection to mysql
<title>My Categories</title>
<?php echo $display_block; ?>

If anyone could help, this would be wonderful! Thank you!

insert in the beginning of the code

print_r( $_GET );

and click of link. scrpit show you $_GET array, maybe it help you see the problem.