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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-30-2011, 01:33 PM   #1
TripleXPrint
Confirmed User
 
TripleXPrint's Avatar
 
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>
Thanks in advance!
__________________
Skype: Triplexprint
TripleXPrint is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 01:36 PM   #2
tical
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
tical is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 01:37 PM   #3
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
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");
Simples.
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 01:40 PM   #4
TripleXPrint
Confirmed User
 
TripleXPrint's Avatar
 
Join Date: Apr 2007
Posts: 983
ROCK & FUCKING ROLL!!!

Thanks!
__________________
Skype: Triplexprint
TripleXPrint is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 01:41 PM   #5
mafia_man
Confirmed User
 
mafia_man's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq#: 639544261
Posts: 1,965
..............
__________________
I'm out.
mafia_man is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 01:47 PM   #6
bbobby86
partners.sexier.com
 
bbobby86's Avatar
 
Industry Role:
Join Date: Jan 2007
Location: San Francisco, CA
Posts: 11,926
thread closed...
__________________

bbobby86 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 02:54 PM   #7
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,053
Quote:
Originally Posted by bbobby86 View Post
thread closed...
Until he asks how to get to the next 12 ;p
__________________
All cookies cleared!
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 03:19 PM   #8
TripleXPrint
Confirmed User
 
TripleXPrint's Avatar
 
Join Date: Apr 2007
Posts: 983
Quote:
Originally Posted by sarettah View Post
Until he asks how to get to the next 12 ;p
I didn't go full retard here.
__________________
Skype: Triplexprint
TripleXPrint is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-30-2011, 04:52 PM   #9
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
osCommerce is such a pile of shit.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-31-2011, 10:46 AM   #10
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,220
Quote:
Originally Posted by GrouchyAdmin View Post
osCommerce is such a pile of shit.
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
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-31-2011, 10:52 AM   #11
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by fris View Post
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.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-31-2011, 10:54 AM   #12
Dappz
Confirmed User
 
Dappz's Avatar
 
Join Date: Dec 2009
Posts: 997
well good luck dude
__________________


Hentai Artist * Draw My Anime *
HentaiLovers * hentaiG4H * ICQ : 657458
Dappz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.