所以我想要在我的PHP页面上查看页面,并使用Google搜索这个...我不想为它创建一个新的数据库,所以我在我的数据库中发现了一个可用的位置(所以不能使用任何解决方案需要在数据库中有超过1个单元格。SQL页面查看Php
我得到了这个代码来计数访问,以便部分工作正常,但我似乎不能让视图的数量显示(打印我猜它是正确的字)
<?php //Adds one to the counter
mysql_query("UPDATE news SET post = post + 1, published=published, last_edit=last_edit WHERE id=$id");
//Retreives the current count
$count1 = mysql_fetch_row(mysql_query("SELECT post FROM post"));
// Displays the count on your site print
echo $count1; ?>
任何想法,为什么我不会得到的结果显示?
此外,在第一个查询您更新的是'news'表,但在第二个你是从尝试'POST'表 – redelschaap 2014-12-07 10:39:02
选择改为:select post from news but still nothing – Milla 2014-12-07 11:02:47
尝试在'mysql_fetch_row()'行之后'var_dump($ count1)'并查看其中的内容 – redelschaap 2014-12-07 11:11:10