Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - show no shipping text
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

show no shipping text

 Post Reply Post Reply
Author
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Topic: show no shipping text
    Posted: 19 November 2004 at 1:10pm

hi I have a database with some products that are free shipping.

I did this coding to have it show free shipping, but didn't work, and the error kept on point at the end if.

<% 'Show noshipping text
call opendb()
mySQL="SELECT noshippingtext FROM products WHERE idproduct=" &pidProduct
set rs=conntemp.execute(mySQL)
pnoshippingtext=rs("noshippingtext")
If pnoshippingtext="-1" then
response.write "Free Shipping"
end if
call closeDb()
set rs=nothing
'End show short product description %>

any help or pointer would be great, thank you in advance.

Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2004 at 5:54pm
well first off is the table "noshippingtext" one of those "yes/no" fields?

forgot wot theyre called in MSSQL

anyway if it is try:

<% 'Show noshipping text
call opendb()
mySQL="SELECT noshippingtext FROM products WHERE idproduct=" &pidProduct
set rs=conntemp.execute(mySQL)
If CBool(rs("noshippingtext")) = True then
   response.write("Free Shipping")
end if

call closeDb()
set rs=nothing
'End show short product description %>

the problem is you had quotes round the -1 but itd prob just be easier to use True or False, without quotes as its not a text field - if it is you might wanna add the quotes

also the CBool() will return the value True or False
Back to Top
webbasterd View Drop Down
Groupie
Groupie


Joined: 21 November 2002
Location: Netherlands
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote webbasterd Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2004 at 6:01pm

I had the same problem using true or false values in a MySQL database. I simply solved this by placing 0 or 1 in the table (int value) and queried the database for 0 or 1 (True or false) This worked fine. On the ASP page I have a pulldown menu wit Yes and No and the value behind the pulldown menu is 0 and 1

With kind regards,

Alexander

Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 19 November 2004 at 6:08pm
Originally posted by Scotty_32 Scotty_32 wrote:

well first off is the table "noshippingtext" one of those "yes/no" fields?

forgot wot theyre called in MSSQL



scotty_32 in MSSQL its a bit field
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.