Answer the question
In order to leave comments, you need to log in
Get max value from tvVar?
How to get the maximum value of an additional field, for the entire table 'modx_site_tmplvar_contentvalues'?
I'm trying to do this, I want to get its id by the field name, and already by id, make a request for max.
The problem is that this query works.
$stmt = $modx->query("SELECT MAX(value) FROM `modx_site_tmplvar_contentvalues` WHERE `tmplvarid` = 34");
$maxId = $stmt->fetch(PDO::FETCH_COLUMN);
$stmt = $modx->query("SELECT id FROM `modx_site_tmplvars` WHERE `name` = price");
$id = $stmt->fetch(PDO::FETCH_COLUMN);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question