shaft Posted October 1, 2015 Share Posted October 1, 2015 (edited) Hi, I am writting a script, that use a db. Last 2 hours I trying to get a value in datetime "from" and "to" column, but withnout sucess. Trying like this: $foreach_speci_price = "2"; $get_speci_to = Db::getInstance()->getValue('SELECT to FROM '._DB_PREFIX_.'specific_price WHERE id_specific_price = \''.pSQL($foreach_speci_price).'\''); echo $get_speci_to; But it is not working. Can anyone help? Thank you. Shaft :-) Edited October 3, 2015 by shaft (see edit history) Link to comment Share on other sites More sharing options...
shaft Posted October 3, 2015 Author Share Posted October 3, 2015 Hi, I am writting a script, that use a db. Last 2 hours I trying to get a value in datetime "from" and "to" column, but withnout sucess. Trying like this: $foreach_speci_price = "2"; $get_speci_to = Db::getInstance()->getValue('SELECT to FROM '._DB_PREFIX_.'specific_price WHERE id_specific_price = \''.pSQL($foreach_speci_price).'\''); echo $get_speci_to; But it is not working. Can anyone help? Thank you. Shaft :-) So after trying next hours it is a simple way. Problem was in table called "to" and "from" ... It is a same name in MySQL syntax. In my case: $foreach_speci_price = "2"; $get_speci_to = Db::getInstance()->getValue('SELECT `to` FROM '._DB_PREFIX_.'specific_price WHERE id_specific_price = \''.pSQL($foreach_speci_price).'\''); echo $get_speci_to; Maybe it help someone. Marked as SOLVED. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now