Jump to content


Photo

Pass 2 url - filter


  • Please log in to reply
No replies to this topic

#1 helwo

helwo
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 28 March 2006 - 09:51 AM

I have two fields in a table that I need filtering. The fields are passed but it does not filter subcat2_id?
can anyone help?
<?php
$colname_store_items = "1";
if (isset($_GET['subcat2_id'])) {
  $colname_store_items = (get_magic_quotes_gpc()) ? $_GET['subcat2_id'] : addslashes($_GET['subcat2_id']);
}
$colname_store_items = "1";
if (isset($_GET['subcat_id'])) {
  $colname_store_items = (get_magic_quotes_gpc()) ? $_GET['subcat_id'] : addslashes($_GET['subcat_id']);
}
mysql_select_db($database_vacuumshop, $vacuumshop);
$query_store_items = sprintf("SELECT * FROM store_items WHERE subcat_id = %s AND store_items.subcat2_id", $colname_store_items);
$store_items = mysql_query($query_store_items, $vacuumshop) or die(mysql_error());
$row_store_items = mysql_fetch_assoc($store_items);
$totalRows_store_items = mysql_num_rows($store_items);
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users