V
V
viktorross2019-09-24 18:51:49
PHP
viktorross, 2019-09-24 18:51:49

Why is the value from the database not displayed in the smarty template?

Hello, tell me why the record id is not displayed from the database to the template?

function maxListUsersViwed($id) {

global $db;
$max_list_users_viewed=$db->fetchRow("select `id` from ".TABLE_AQQ." where `user_id`='$id' ORDER BY `viewed` DESC LIMIT 1");
if(!$max_list_users_viewed) return 0;
    return $max_list_users_viewed;
}

$max_list_users_viewed = $usr->maxListUsersViwed($crt_usr);
$smarty->assign("$max_list_users_viewed", $max_list_users_viewed);

<a href="{$live_site}/edit.php/id={if isset($max_list_users_viewed) && $max_list_users_viewed}{$max_list_users_viewed}{else}0{/if}">&nbsp;</a>

What's wrong here? the else value is displayed, i.e. 0...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2019-09-24
@viktorross

in assign, the dollar sign is extra in the first parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question