Jump to content

Recommended Posts

Hi All, Thanks for reading!

 

Okay so I have a table called orders_total. In this table I have orders_total_id, orders_id, title, text, value, class, sort_order.

The "Title" column holds the names Total, SubTotal and Various Shipping titles. The "Class" column holds info like "ot_total, ot_subtotal and ot_shipping".

 

So I start with

$order_shipping = $db->Execute("select *

                            from " . TABLE_ORDERS_TOTAL . "

                            where orders_id = '" . (int)$oID . "'");

 

Then I need to echo only the "Title" for the row where the column "Class" holds the value "ot_shipping".

So my db execute may return 3 or 4 rows of data and I only want the title from the one thats class is "ot_shipping".

 

 

Thanks in advance,

                          John

 

 

Link to comment
https://forums.phpfreaks.com/topic/105147-solved-getting-info-from-mysql-db/
Share on other sites

Hey Thanks for the Help.

 

This is the error I get when using that code.

 

1054 Unknown column 'ot_shipping' in 'where clause'

in:

[select title from orders_total where orders_id = '52117' AND class = ot_shipping]

 

Please advise. Hey, I'm new and I'm trying.

 

Thank you very much for your time,

              John

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.