更新(那个有效)
<?php
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load($nid);
if ($node->type == 'webform') {
$count = db_result(db_query('SELECT count(*) FROM {webform_submissions} WHERE nid = %d', $nid));
$atelier_1 = "sources" ;
$sql = "SELECT count(*) FROM {webform_submitted_data} WHERE data LIKE \"".$atelier_1."\" ;";
$count_atel_1 = db_result(db_query($sql));
}
}
echo $sql;
echo $count_atel_1;
?>
This webform has been submitted <?php print $count ?> times.
我们想使用一个网络表格,以便我们的学生可以在一些研讨会上注册。
网络表单效果很好。现在我们想实时显示已经注册的学生人数,以便其他人知道是否还有注册的可能性(每个工作坊只能同时接受 20 名学生)
我正在尝试那个不起作用($atelier_1 = "sources" ;) 是一个研讨会的名称:
<?php
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load($nid);
if ($node->type == 'webform') {
$count = db_result(db_query('SELECT count(*) FROM {webform_submissions} WHERE nid = %d', $nid));
$atelier_1 = "sources" ;
$count_atel_1 = db_result(db_query('SELECT count(*) FROM {webform_submitted_data} WHERE data LIKE %d', $atelier_1');
}
}
echo $count_atel_1;
?>
欢迎任何帮助或建议