Post by boopbeepforum » Sun Jun 20, 2021 9:00 am

In the stock code, why do some identical database queries sometimes have this `` symbol around the prefix_table, and should I use it?

Below are some examples
$this->db->query("UPDATE `" . DB_PREFIX . "order`...........
$this->db->query("INSERT INTO " . DB_PREFIX . "order_history........
$this->db->query("SELECT * FROM `" . DB_PREFIX . "order_total`........
$this->db->query("SELECT * FROM " . DB_PREFIX . "order_total..........

Newbie

Posts

Joined
Tue May 18, 2021 9:40 pm

Post by straightlight » Sun Jun 20, 2021 9:25 am

boopbeepforum wrote:
Sun Jun 20, 2021 9:00 am
In the stock code, why do some identical database queries sometimes have this `` symbol around the prefix_table, and should I use it?

Below are some examples
$this->db->query("UPDATE `" . DB_PREFIX . "order`...........
$this->db->query("INSERT INTO " . DB_PREFIX . "order_history........
$this->db->query("SELECT * FROM `" . DB_PREFIX . "order_total`........
$this->db->query("SELECT * FROM " . DB_PREFIX . "order_total..........
User defined due to reserved terms already used by the industry. It is also known to be used due to some web servers believing these can be function names as opposed to used defined names but that one is still a puzzle.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Sun Jun 20, 2021 8:24 pm

boopbeepforum wrote:
Sun Jun 20, 2021 9:00 am
In the stock code, why do some identical database queries sometimes have this `` symbol around the prefix_table, and should I use it?

Below are some examples
$this->db->query("UPDATE `" . DB_PREFIX . "order`...........
$this->db->query("INSERT INTO " . DB_PREFIX . "order_history........
$this->db->query("SELECT * FROM `" . DB_PREFIX . "order_total`........
$this->db->query("SELECT * FROM " . DB_PREFIX . "order_total..........
https://dev.mysql.com/doc/refman/8.0/en ... fiers.html

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: Bing [Bot] and 29 guests