Where's the error?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have this script which SHOULD produce a linked webpage for soon-to-be
created static web pages, however I can't seem to find the error in my
code:

<?php
//connect to database
include 'db.php';

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

//Show categories first
$get_cats = "select id_num, id_name, description, cat_code from
PFS_categories order by id_name";
$get_cats_res = mysql_query($get_cats) or die(mysql_error());

if (mysql_num_rows($get_cats_res) < 1)
{
 $display_block = "<P><em>Sorry, no categories to browse.</em></P>";
}
else
{
 while ($cats = mysql_fetch_array($get_cats_res))
 {
  $cat_id = $cats[id_num];
  if ($cat_id != "53" || $cat_id != "54" || $cat_id != "55" || $cat_id
!= "117" || $cat_id != "118")
  {
  $cat_title = strtoupper(stripslashes($cats[id_name]));
  $cat_desc = stripslashes($cats[description]);
  $display_block .= "<strong><a
href=$_SERVER[PHP_SELF]?cat_id=$cat_id>$cat_title
$cat_desc</a></strong><br>\n";
  
  if ($_GET[cat_id] == $cat_id) //get items
  {
   $get_items = "select id, item_num, description from PFS_items where
cat_code = $cat_id";
   $get_items_res = mysql_query($get_items) or die(mysql_error());
   
   if (mysql_num_rows($get_items_res) < 1)
   {
    $display_block = "<P><em>Sorry, no Items to browse.</em></P>\n";
   }
  else
  {
#   $display_block .= "<ul>\n";
   while ($items = mysql_fetch_array($get_items_res))
   {
    $item_id = $items[id];
    $item_num = $items[item_num];
    $item_desc = stripslashes($items[description]);
    if ($item_num != "ABC-R37" || $item_num !=  "ABC-R42" || $item_num
!= "HB-99100" || $item_num != "RO-PUMPS" || $item_num != "ML-HDGALJUG"
|| $item_num != "PFS-CAC21" || $item_num != "PFS-CO2")
    {
    $display_block .= "&nbsp;&nbsp;&nbsp;&nbsp;<em><strong><a
href=\"catalog/$item_id.html\">$item_num</strong> -
$item_desc</em><br>\n";
    } 
   }
#   $display_block .= "<br>\n";
#   $display_block .= "</ul>\n";
  }}
 }
}
?>
<HTML>
<HEAD>
<TITLE>Categories of Items</TITLE>
<BODY>
<?php
 include("nav/top_nav.html");
?>
<?php
 include("nav/side_nav.html");
?>
  <!--START PAGE CONTENT HERE-->

<?php print $display_block; ?>

  <!--END PAGE CONTENT HERE-->

<?php
 include("nav/bottom_nav.html");
?>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux