Welcome Guest, Not a member yet? Register   Sign In
Assign value from SQL to variable
#1

Hi guys!

I have a very simple question.

I would like to assign SQL-query result (which is only 1 row and 1 column) to my variable, and when make calculations with them.

This is SQL select query, which should be assigned to variable $timezone:

Code:
'SELECT gtm FROM wh_rates WHERE (city_id = "'.$sity_id.'" OR city_id_en = "'.$sity_id.'") LIMIT 1'

This is why I need variable $timezone (to make it clear for you):


Code:
$current_day = gmdate("N", time() + 3600*($timezone+date("I")));
$current_time = gmdate("H", time() + 3600*($timezone+date("I")));



Can anybody help me?   Cool
Reply


Messages In This Thread
Assign value from SQL to variable - by dmitrykanaev - 02-11-2018, 01:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB