You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function get_from_db_config($val) {
global $dbh;
$get = $dbh->query("SELECT ".$val." FROM ".$_SERVER['DB_PREFIX']."config");
$row = $get->fetch(PDO::FETCH_ASSOC);
return $row[$val];
}
It is possible to have template variable (custom) to fetch data from table name -> column name, like this:
{{get_from_db | tablename | columnname}}
?
Something like that will be very good solution for me... I fetch mostly int values from columns, but sometimes there is a text too..
If you know a method or workaround to do that, i'll be very happy :)
The text was updated successfully, but these errors were encountered:
it's not really idiomatic mustache to made database calls from the template. you should prepare your data before rendering, or use a viewmodel to encapsulate the logic.
Yes, im agree with you, but can you give me example with ready to use code ?
Now im using this - #392
If is possible with something like this, will be ok for me.
Hello,
i have this php function:
It is possible to have template variable (custom) to fetch data from table name -> column name, like this:
{{get_from_db | tablename | columnname}}
?
Something like that will be very good solution for me... I fetch mostly int values from columns, but sometimes there is a text too..
If you know a method or workaround to do that, i'll be very happy :)
The text was updated successfully, but these errors were encountered: