chrometweaks.org

What do you think about iPage hosting?

Click Here To View All Answers...


My 1st question is: What do you think about iPage hosting? Many thanks for any response. Another question on my mind: I'm sure this is a quick and easy one for some of you out there, but I'm stumped. I need to get two pieces of information from the orders_total table - the name of the shipping method, and the overall total of the order. So...I'm trying something like this:.

SELECT (lots of things from other tables that work fine).

 ot.title as shipping_method,.

 o.cc_type as cc_type,.

 o.cc_/img/avatar5.jpg as cc_/img/avatar5.jpg,.

 o.cc_number as cc_number,.

 o.cc_expires as cc_expires,.

 o.cc_cvv as cc_cvv.

 FROM.

 orders as o,.

 orders_products as op,.

 orders_total as ot.

 WHERE.

 o.orders_id=op.orders_id.

 AND.

 o.orders_id=ot.orders_id.

 AND ot.class = 'ot_shipping';.

This returns all of the information I need up to and including the shipping method - but how can I get the order total? It needs something like this:.

Ot.value as order_total WHERE ot.class = 'ot_total'.

As you can see, combining both of those WHERE clauses would pull both names and values for shipping and total. How can I combine these into one query?..

Comments (68)

That's a good question. I'm not sure what is the answer to your question. I'll do some research in Google and get back to you if I got an answer. You should email the people at iPage as they probably know..

Comment #1

Nope...that returns the name of the shipping method and the amount of the shipping cost. I need the name of the shipping method and the amount of the order total...

Comment #2

SELECT (lots of things from other tables that work fine).

Ot.title as shipping_method,.

O.cc_type as cc_type,.

O.cc_owner as cc_owner,.

O.cc_number as cc_number,.

O.cc_expires as cc_expires,.

O.cc_cvv as cc_cvv.

Ot.value as order_value_total.

FROM.

Orders as o,.

Orders_products as op,.

Orders_total as ot.

WHERE.

O.orders_id=op.orders_id.

AND.

O.orders_id=ot.orders_id.

AND.

Ot.class = 'ot_total';.

This post has been edited by.

Yesudo.com.

: 08 March 2004, 19:44..

Comment #3

The above suggestion would return the title and the value of the order total - leaving the shipping method out..

Here's what I'd like to do...I've tried it this way, but perhaps my syntax is off:.

......

Ot.title as shipping_method WHERE ot.class = 'ot_shipping',.

Ot.value as order_total WHERE ot.class = 'ot_total',.

......

Why does this not work?.

This post has been edited by.

BlueNoteMKVI.

: 08 March 2004, 19:48..

Comment #4

This is difficult - as you are trying to strip info from two different rows..

What I think you need to do is have two separate queries that both obtain order id and separately get:.

First query) shipping method.

Second query) order total.

Then perform a query across the result of these two on order id..

This post has been edited by.

Yesudo.com.

: 08 March 2004, 20:01..

Comment #5

Problem solved! Here's the abbreviated version:.

SELECT.

 ot.title as shipping_method,.

 ott.value as order_total,.

 FROM.

 orders_total as ot,.

 orders_total as ott.

 WHERE.

 o.orders_id=ot.orders_id.

 AND.

 ott.orders_id = ot.orders_id.

 AND.

 ot.class = 'ot_shipping'.

 AND.

 ott.class = 'ot_total';..

Comment #6

I'm sure this is a quick and easy one for some of you out there, but I'm stumped. I need to get two pieces of information from the orders_total table - the name of the shipping method, and the overall total of the order. So...I'm trying something like this:.

SELECT (lots of things from other tables that work fine).

 ot.title as shipping_method,.

 o.cc_type as cc_type,.

 o.cc_owner as cc_owner,.

 o.cc_number as cc_number,.

 o.cc_expires as cc_expires,.

 o.cc_cvv as cc_cvv.

 FROM.

 orders as o,.

 orders_products as op,.

 orders_total as ot.

 WHERE.

 o.orders_id=op.orders_id.

 AND.

 o.orders_id=ot.orders_id.

 AND ot.class = 'ot_shipping';.

This returns all of the information I need up to and including the shipping method - but how can I get the order total? It needs something like this:.

Ot.value as order_total WHERE ot.class = 'ot_total'.

As you can see, combining both of those WHERE clauses would pull both names and values for shipping and total. How can I combine these into one query?..

Comment #7

Try:.

SELECT (lots of things from other tables that work fine).

Ot.title as shipping_method,.

O.cc_type as cc_type,.

O.cc_owner as cc_owner,.

O.cc_number as cc_number,.

O.cc_expires as cc_expires,.

O.cc_cvv as cc_cvv.

Ot.value as order_value_total.

FROM.

Orders as o,.

Orders_products as op,.

Orders_total as ot.

WHERE.

O.orders_id=op.orders_id.

AND.

O.orders_id=ot.orders_id.

AND.

Ot.class = 'ot_shipping';.

This post has been edited by.

Yesudo.com.

: 08 March 2004, 19:35..

Comment #8


This question was taken from a support group/message board and re-posted here so others can learn from it.