以下代码无效:
<?php
$sql = 'SELECT sum(display) AS nb_total FROM tracking where id_site ="'.$id_site.'"';
$req = mysql_query($sql) or die('Erreur SQL !'.$sql.''.mysql_error());
$data = mysql_fetch_array($req);
echo $data['nb_total'];
?>
请帮助我
答案 0 :(得分:1)
试试这个:
$sql = "SELECT sum(display) AS nb_total FROM tracking where id_site =$id_site";
答案 1 :(得分:0)
像这样纠正这条线
$sql = "SELECT sum(display) AS nb_total FROM tracking where id_site ='$id_site'";