bumba000 Posted May 11, 2008 Share Posted May 11, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/105147-solved-getting-info-from-mysql-db/ Share on other sites More sharing options...
MadTechie Posted May 11, 2008 Share Posted May 11, 2008 unless i am missing something wouldn't it just be "select Title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' AND Class = ot_shipping" Quote Link to comment https://forums.phpfreaks.com/topic/105147-solved-getting-info-from-mysql-db/#findComment-538347 Share on other sites More sharing options...
bumba000 Posted May 11, 2008 Author Share Posted May 11, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/105147-solved-getting-info-from-mysql-db/#findComment-538359 Share on other sites More sharing options...
MadTechie Posted May 11, 2008 Share Posted May 11, 2008 oopps, i assumed ot_shipping was a field, try this, (using the value of ot_shipping) "select Title from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$oID . "' AND Class = 'ot_shipping'" Quote Link to comment https://forums.phpfreaks.com/topic/105147-solved-getting-info-from-mysql-db/#findComment-538362 Share on other sites More sharing options...
bumba000 Posted May 11, 2008 Author Share Posted May 11, 2008 Got It! Thank you sooo much for your help. John Quote Link to comment https://forums.phpfreaks.com/topic/105147-solved-getting-info-from-mysql-db/#findComment-538394 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.