Jump to content

wond3r

Members
  • Posts

    4
  • Joined

  • Last visited

wond3r's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. this is my query at the top, sorry <?php require_once("connect.php"); if(isset($_GET['userSearch'])) { $srch=$_GET['userSearch']; $allMov = "SELECT * FROM tbl_products WHERE products_name LIKE '%". $srch."%' ORDER BY products_name"; } else if (isset($_GET['nav'])) { $select=$_GET['nav']; $allMov = "SELECT * FROM tbl_products, tbl_cat, tbl_l_pc WHERE tbl_products.products_id =tbl_l_pc.products_id AND tbl_cat.cat_id=tbl_l_pc.cat_id AND tbl_cat.cat_name = '".$select."' ORDER BY tbl_products.products_name ASC"; } else{ $allMov = "SELECT * FROM tbl_products ORDER BY products_name ASC"; } $movResults = mysql_query($allMov) or die (mysql_error()); ?>
  2. $movResults = mysql_query($allMov) or die (mysql_error()); No database selected
  3. I was looking into that for the last 15 minutes and I cant figure out where to put(inside of the php code at the top, or in that php code I posted which is the error section) that or how to use it exactly.
  4. Im not sure what to include here so I will show those specific areas... <?php $con=0; while($row = mysql_fetch_array($movResults)){ if($con == 0) { echo "<div class=\"container\"> <div class=\"row\"> <div class=\"fourcol\"> <div class=\"movImg\"> <img src=\"images/".$row['products_thumb']."\" alt=\"".$row['products_name']."\"> </div> <div class=\"movTxt\"> <h3>".$row['products_name']."</h3> <p>".$row['products_price']."</p> <a href=\"productdetail.php?id=".$row['products_id']."\">View Product.....</a> </div> </div>"; $con++; }else if($con == 1){ echo "<div class=\"fourcol\"> <div class=\"movImg\"> <img src=\"images/".$row['products_thumb']."\" alt=\"".$row['products_name']."\"> </div> <div class=\"movTxt\"> <h3>".$row['products_name']."</h3> <p>".$row['products_price']."</p> <a href=\"productdetail.php?id=".$row['products_id']."\">View Product.....</a> </div> </div>"; $con++; }else if($con == 2){ echo"<div class=\"fourcol last\"> <div class=\"movImg\"> <img src=\"images/".$row['products_thumb']."\" alt=\"".$row['products_name']."\"> </div> <div class=\"movTxt\"> <h3>".$row['products_name']."</h3> <p>".$row['products_price']."</p> <a href=\"productdetail.php?id=".$row['products_id']."\">View Product.....</a> </div> </div> </div> </div> <div class=\"row\">"; $con = 0; } } $numRows = mysql_num_rows($movResults); $div = $numRows%3; if($div==1){ echo"<div class=\"eightcol last\"></div></div></div>"; }else if($div==2){ echo"<div class=\"fourcol last\"></div></div></div>"; } ?> I really dont understand whats happening. I'm new to this
×
×
  • 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.