Jump to content

crowds40

New Members
  • Posts

    8
  • Joined

  • Last visited

crowds40's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the response. I wish to output all three colors (blue,green,white) in the same link from the array if possible
  2. I don't exactly know what you mean by what format. Sorry I am new to this.
  3. Hi mac_gyver, I am trying to have one link that will contain the 'blue' 'green' and 'white' values from the array
  4. I had to take it one step further to: <?php $test = array('blue','green','white'); foreach($test as $val) $testValues[] = "color=$val"; echo "<a href='?"; echo join("&", $testValues); echo "'>Color</a>"; ?> The url is "website.com?color=blue&color=green&color=white" Again this this will only return the white and not the blue, green, and white. Hope that makes sense. Any ideas?
  5. For some reason this array will only return 'white'. Is there a problem with the code? <?php $test = array('blue','green','white'); foreach($test as $val) ?> <?php echo "$val"; ?>
  6. My code does display the proper counts by price range. For example: Products $0.00-$25.00 (12) But I cant get the right link to display the all 12. <a href="?sale_price='.$sale_price.'"> This code will only display the $24 products and not the rest lower. It there an href that will display all 12 from the query?
  7. Thanks for the responses. I was using GROUP BY (sale_price BETWEEN '$0' AND '$25') before and it didn't seem to make a difference using it and not using it. For the href the main problem seems to be '.$sale_price.' Is there any chance something like this or along these lines will work href="?sale_price='.$sale_price < '25'.' or $range = "'.$sale_price.' BETWEEN $0 AND $25" href="?sale_price='$range'" Before I had a price_range column in my database but it just takes to long to put each one in manually and was hoping there was a code to read sale_price column automatically. Would this work or is it just to far fetched?
  8. I have a clothing store website which displays all my products with a price range of $0-$25 great on left side of my webpage with the count number beside it like so. $0-$25 (12) My code is <?php $sidebar_price =""; $price_sql = mysql_query("SELECT *,COUNT(sale_price) FROM products WHERE subcategory = 'Shirts' AND category = 'Women' AND (sale_price BETWEEN '$00.00' AND '$25.00')"); $prCount = mysql_num_rows($price_sql); if ($prCount > 0) { while($row = mysql_fetch_array($price_sql)){ $sale_price = $row["sale_price"]; $sidebar_price .= '<div id="sidebar"><label><form action="?"method="POST"><input type="checkbox" name="sale_price" value="'.$sale_price.'" onClick="submit(); return false" ' . (isset($_POST['sale_price']) && $_POST['sale_price']==$row['sale_price'] ? 'checked="checked"' : '') . ' /><a href="?sale_price='.$sale_price.'">$0-$25 ('.$row["COUNT(sale_price)"].')</a></form></label></div>'; } } ?> How do I get it so when a customer clicks on either the checkbox or the href the products will display? Right now when I click on the href or checkbox it will only display the products with prices for example just $24.99 and not all the products between $0.00-$25.00 like $24.99, $22.6, 19.35, etc.. If it is not clear enough I will try to explain further. Any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.