Opencart Read values from database

$sql = “SELECT *from ” . DB_PREFIX . “manual_settings where name=’store_status'”;
$query = $this->db->query($sql);
$result = $query->rows;
$store_status =$result[0][‘value’];

$msg=””;
if ($store_status == 2) {
$data[‘store_close’]= $this->language->get(‘store_close’);
$data[‘store_open’] = “”;
} elseif ($store_status == 1) {
$data[‘store_open’] = $this->language->get(‘store_open’);
$data[‘store_close’]= “”;
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s