Jump to content

[SOLVED] Get datetime "to" and "from" from specific price in script using


Recommended Posts

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 by shaft (see edit history)
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...