Jump to content

[SOLVED] Getting info from MySql DB


bumba000

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.