M
M
Mikha Pankratov2016-10-26 17:23:46
MySQL
Mikha Pankratov, 2016-10-26 17:23:46

How to specify SET @var in ActiveRecord?

Good afternoon,
here I would like to make a calculation in the request.
Simple query, simple question) How to specify in ActiveRecord SET var := 0;
Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-10-26
@slo_nik

Good evening.

// определяем переменну
public $count_var = 0;
// обращение к переменной
$this->count_var

E
eudj1n, 2016-11-10
@eudj1n

The solution needs more input. Alternatively, you can group records by the required field and get count(*)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question