I am trying to create social links.
My database fields are
----------------------------------------------------------------------------------------------------------------------
| SocialId | SocialName | ButtonClass | SocialIcon | SocialUrl | SocialShow | SocialSort |
----------------------------------------------------------------------------------------------------------------------
| 1 | Facebook | btn btn-social btn-facebook | icon-facebook | # | active | 1 |
----------------------------------------------------------------------------------------------------------------------
| 2 | Twitter | btn btn-social btn-twitter | icon-twitter | # | active | 2 |
----------------------------------------------------------------------------------------------------------------------
and for this, I coded like below:
// Social Links ---------------------------------------------------
mysql_select_db($db,$con);
$qry5 = "SELECT * FROM social ORDER BY SocialSort ASC";
$clt_soc = mysql_query($qry5,$con);
$clt_social = mysql_fetch_assoc($clt_soc);
function cltsocial(){
global $clt_social;
$soc_show = $clt_social('SocialShow');
$soc_class = $clt_social('SocialClass');
$soc_url = $clt_social('SocialUrl');
$soc_icon = $clt_social('Social_Icon');
if($soc_show === 'active'){
do{
echo '<a class=\"'.$soc_class.'\" href=\"'.$soc_url.'" style=\"color:#fff\" <i class=\"'.$soc_icon.'\"</i></a>  ';
}while ($clt_social = mysql_fetch_assoc($clt_soc));
}
}
Now I call this function like this <?php cltsocial() ?>
But there's an error showing
Fatal error: Function name must be a string in C:\xampp\htdocs\mywebsite\incl\functions\functions.php on line 87
I am unable to find my fault... What should I do?