I have a random mysql response. I need to display the response in smarty template. I want to add dots in one column, but don’t know how to do it. Here is my code:
function homepage_profiles()
{
$sql = "
SELECT
*
FROM
tbl_profile
WHERE
bz_pro_show = 'Y'
ORDER BY
RAND()
";
$res = $this->db->returnArrayOfObject($sql, $pgin = 'no', $odr='no');
return $res;
}
$res_pro = $this->homepage_profiles();
$this->assign_values('rand_pro',$res_pro);
You could either use Smarty with something like
{$rand_pro|truncate:50:'...'}or MySql with something likeSELECT CONCAT(LEFT(about_me, 50),"...") as about_me_trunc…