GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP/MySql help... (https://gfy.com/showthread.php?t=1016403)

TripleXPrint 03-30-2011 01:33 PM

PHP/MySql help...
 
I'm setting up a new store using CMS to sell sex toys, movies, etc. An online adult store specializing in niche oddities and arousals. I have it set up so all of the products show up on the main page under most popular products. However, it will not stop listing them so when I have 500 products, my index body content has 500 products. I want to stop the display at 12 items. Below is the code, how do I change it so it stops after 12 products are displayed?

Code:

    <div id="our_prod">
    <h1>popular products</h1>
  <?
  $selprod=mysql_query("select p.products_id,pd.products_name ,p.products_image from products p,products_description pd where p.products_id=pd.products_id and pd.language_id=1 and p.special_status=1 and p.left_status");
  $cx=0;
  while($selprodD=mysql_fetch_array($selprod)){
  $cx=$cx+1;
  ?>
    <div <? if($cx%4==1){?>class="prod_dis" <? } else{?>class="prod_dis"<? }?>>
    <div class="tlt"><?=$selprodD['products_name'];?></div>
    <div class="img"><a href="#"><img src="images/<?=$selprodD['products_image'];?>" alt=""  width="125" height="65"/></a></div>
    <div class="btn"> <a href="<?=tep_href_link("product_info.php","products_id=".$selprodD['products_id']); ?>"><img src="images/buy_now_btn.gif" alt="" /></a></div>
      </div>

Thanks in advance! :thumbsup

tical 03-30-2011 01:36 PM

select p.products_id,pd.products_name ,p.products_image from products p,products_description pd where p.products_id=pd.products_id and pd.language_id=1 and p.special_status=1 and p.left_status limit 12

redwhiteandblue 03-30-2011 01:37 PM

Change the query line to

Code:

$selprod=mysql_query("select p.products_id,pd.products_name ,p.products_image from products p,products_description pd where p.products_id=pd.products_id and pd.language_id=1 and p.special_status=1 and p.left_status limit 12");
Simples.

TripleXPrint 03-30-2011 01:40 PM

ROCK & FUCKING ROLL!!! :thumbsup

Thanks!

mafia_man 03-30-2011 01:41 PM

..............

bbobby86 03-30-2011 01:47 PM

thread closed...

sarettah 03-30-2011 02:54 PM

Quote:

Originally Posted by bbobby86 (Post 18015329)
thread closed...

Until he asks how to get to the next 12 ;p

TripleXPrint 03-30-2011 03:19 PM

Quote:

Originally Posted by sarettah (Post 18015544)
Until he asks how to get to the next 12 ;p

I didn't go full retard here.

GrouchyAdmin 03-30-2011 04:52 PM

osCommerce is such a pile of shit.

fris 03-31-2011 10:46 AM

Quote:

Originally Posted by GrouchyAdmin (Post 18015806)
osCommerce is such a pile of shit.

I think that is your comment towards every piece of software that you didnt create ;)

GrouchyAdmin 03-31-2011 10:52 AM

Quote:

Originally Posted by fris (Post 18017568)
I think that is your comment towards every piece of software that you didnt create ;)

It's still not as much of a pile of shit as WordPress, though.

Dappz 03-31-2011 10:54 AM

well good luck dude :)


All times are GMT -7. The time now is 07:33 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc