Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $i=0;
- $pieces = explode(" ", $products_name);
- $productname=$pieces[1]." ".$pieces[2];
- $productname1="%".$productname."%";
- $productname2="%".$pieces[1]."%";
- $productname3="%".$pieces[0]."%";
- $query="select * from products_description where products_name LIKE '$productname3' OR '$productname1' OR '$products_name' limit 0,$popular_at_shop";
- //$query="select * from products_description where products_name like '$productname1' or '$productname2' or '$productname3' limit 0,$popular_at_shop";
- $qry=mysql_query($query);
- $qry1=mysql_num_rows($qry);
- if($qry1>0)
- {
- ?>
- <?php
- while($result=mysql_fetch_array($qry))
- {
- if($i==0 || $i%3==0)
- {
- echo '<tr valign="top">';
- }
- echo '<td align="center" width="300px;" style="padding-left:20px; padding-top:10px; padding-bottom:10px;">';
- ?>
- <a href="<?php echo tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $result['products_id']); ?>"><div class="popularatshop"><?php echo substr($result['products_name'],0,28); ?>...</div></a>
- <?php
- if (($i+1)%3==0)
- {
- echo '</td></tr>';
- }
- $i++;
- }
- }
- echo '</table></td></tr><tr>';
- ?></div>
- <div>
- </div>
- <!-- End Wrapper -->
- <?php
- if (isset($HTTP_GET_VARS['products_id'])) {
- $i=0;
- $id=$HTTP_GET_VARS['products_id'];
- /*
- $orders_query = mysql_query("select p.products_id, p.products_image from orders_products opa, orders_products opb, orders o, products p where opa.products_id = '$id' and opa.orders_id = opb.orders_id and opb.products_id != '$id' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit 0,$also_purchase_limit");
- */
- $orders_query = mysql_query("select p.products_id, p.products_image from products p, categories c, products_to_categories ptc where p.products_id = ptc.products_id and c.categories_id = ptc.categories_id and c.categories_id in (select categories_id from products_to_categories where products_id = '$id') order by rand() limit 0, 21");
- $also1=mysql_num_rows($orders_query);
- if($also1>0)
- {
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement