Answer the question
In order to leave comments, you need to log in
The simplest example of outputting strings from a database to an input in a smarty template via Ajax?
hello, please tell me the simplest sketch of a working example. I have a table that contains all the cities, I want to make it so that when you start entering the first letters in the input, matches are displayed, something like in select2 you wrap the usual select. The smart template is used.
In one file there are queries to the database, such
function userRegion($id) {
global $db;
$user_region=$db->fetchRow("select `gorod` from ".TABLE_USERS." where `id`='$id'");
if(!$user_region) return 0;
return $user_region;
}
$user_info_get = $usr->getInfoForUser($crt_usr);
$smarty->assign("user_info_get", $user_info_get);
{if $user_info_get}{$user_info_get}{/if}
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