错误在哪里?

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>&nbsp;&nbsp';
        }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?

  1. You must call your function like this, note the ; at the end:

    <?php 
        cltsocial(); 
    ?>
    

    Even if it's a single line, you should terminate it with a ;

  2. $ctl_social is an array, not a function:

    These:

    $soc_show = $clt_social('SocialShow');
    $soc_class = $clt_social('SocialClass');
    $soc_url = $clt_social('SocialUrl');
    $soc_icon = $clt_social('Social_Icon');
    

    Should be:

    $soc_show = $clt_social['SocialShow'];
    $soc_class = $clt_social['SocialClass'];
    $soc_url = $clt_social['SocialUrl'];
    $soc_icon = $clt_social['Social_Icon'];
    

Also, as a suggestion, you shouldn't be using the mysql extensions, either use the mysqli or PDO extensions and prepared statements. Here's why.