VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Problems and bugs
 CINT Function large DB
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dencom
Starting Member

New Zealand
2 Posts

Posted - April 12 2006 :  19:40:23  Show Profile  Reply with Quote
FYI
I have found in shoprandom.asp at line 161 an 163 you are using CINT functions which is great if you have only 32767 products. I would recommend changing this to Clng.

Also the Sub DisplayRandomprodcuts loops through the entire database, not practical with a large database. I am having to rewrite this feature.

support
Administrator

4266 Posts

Posted - April 12 2006 :  21:10:15  Show Profile  Visit support's Homepage  Reply with Quote
Hi there,

You can limit the number of products the script chooses from by just generating random products of the latest 100 products, for example.

To do that, edit the following lines in shoprandomproducts.asp:

line 136:
sqlstr="SELECT catalogid FROM products where hide=0"

replace with:
sqlstr="SELECT TOP 100 catalogid FROM products where hide=0"

Then add another line below line 148:
sqlstr = sqlstr & " ORDER BY catalogid DESC"

So it should look like:
sqlstr = sqlstr & " AND (highercatalogid is null)"
sqlstr = sqlstr & " ORDER BY catalogid DESC"

If you are using MySQL, ignore the first change, and add the following under line 148:
sqlstr = sqlstr & " LIMIT 0,100 ORDER BY catalogid desc"

So it looks like:
sqlstr = sqlstr & " AND (highercatalogid is null)"
sqlstr = sqlstr & " LIMIT 0,100 ORDER BY catalogid desc"

Hope that helps.

Regards,
Joseph


Edited by - support on April 12 2006 21:48:23
Go to Top of Page

dencom
Starting Member

New Zealand
2 Posts

Posted - April 12 2006 :  21:58:05  Show Profile  Reply with Quote
Great. Worked a treat.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000