![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Apr 2007
Posts: 983
|
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> ![]()
__________________
Skype: Triplexprint |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Feb 2002
Location: Las Vegas
Posts: 6,504
|
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
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Bollocks
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
|
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");
__________________
Interserver unmanaged AMD Ryzen servers from $73.00 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Apr 2007
Posts: 983
|
ROCK & FUCKING ROLL!!!
![]() Thanks!
__________________
Skype: Triplexprint |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jul 2005
Location: icq#: 639544261
Posts: 1,965
|
..............
__________________
I'm out. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
partners.sexier.com
Industry Role:
Join Date: Jan 2007
Location: San Francisco, CA
Posts: 11,926
|
thread closed...
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,053
|
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Apr 2007
Posts: 983
|
I didn't go full retard here.
__________________
Skype: Triplexprint |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
osCommerce is such a pile of shit.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,220
|
I think that is your comment towards every piece of software that you didnt create ;)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Now choke yourself!
Industry Role:
Join Date: Apr 2006
Posts: 12,085
|
It's still not as much of a pile of shit as WordPress, though.
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Dec 2009
Posts: 997
|
well good luck dude
![]()
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |