Jump to content

Recommended Posts

$this->data['idusers'] = $this->db->query("SELECT `balance` FROM `vor_customer` WHERE `customer_id` = '"$this->customer->getId()"'") or die ("Ne verno");

В файле controller/payment/cheque.php выкидывает ошибку:

 

Parse error: syntax error, unexpected T_VARIABLE in /home/host1255/v/htdocs/www/catalog/controller/payment/cheque.php on line 6

 

Ошибка явно в запросе sql, все таблицы существуют и верны, проверял в phpmyadmin этим же sql запросом.

 

 

В чем беда?

Share this post


Link to post
Share on other sites

$this->data['idusers'] = $this->db->query("SELECT `balance` FROM `vor_customer` WHERE `customer_id` = '".$this->customer->getId()."'") or die ("Ne verno");

Share this post


Link to post
Share on other sites

$this->data['idusers'] = $this->db->query("SELECT `balance` FROM `vor_customer` WHERE `customer_id` = '".$this->customer->getId()."'") or die ("Ne verno");

 

Не понятно, помогло или нет, вывод cheque.tpl 

echo $idusers;  ничего не выводит, а должен вывести 12300

Edited by Morebankru

Share this post


Link to post
Share on other sites

Выдает ошибку 2015-09-30 17:13:09 - PHP Unknown:  Object of class stdClass could not be converted to string in /home/host126/vor-res/htdocs/www/catalog/view/theme/tecart/template/payment/cheque.tpl on line 11

 

В строке 

echo $idusers;

Share this post


Link to post
Share on other sites
print_r ($idusers);  

выдает 

stdClass Object ( [row] => Array ( [balance] => 12300 ) [rows] => Array ( [0] => Array ( [balance] => 12300 ) ) [num_rows] => 1 )

Share this post


Link to post
Share on other sites

Решил вопрос переводом в массив

 

 

 $arr = (array)$idusers;
 echo $arr['row']['balance'];

Share this post


Link to post
Share on other sites

Ну пожалуйста, что ли...

Share this post


Link to post
Share on other sites

)))

 

А как теперь получить общую сумму заказа из confirm.tpl и вывести в cheque.tpl ?

Share this post


Link to post
Share on other sites

На одного говно-кодера стало больше, аминь :(

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.