Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14114

Assign value from SQL to variable

$
0
0
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

Viewing all articles
Browse latest Browse all 14114


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>