【发布时间】:2014-08-13 11:30:45
【问题描述】:
我有一个页面,我可以在其中收集和存储页面浏览量,我有一个 php 查询,可以在单击按钮时存储我的页面浏览量,
if(isset($_POST['submit'])){
mysql_select_db($database_epl, $epl);
$query_lin = sprintf("SELECT * FROM topic WHERE id = %s ORDER BY `Date` DESC", GetSQLValueString($colname_lin, "int"));
$topicId = $_GET['id']; // you need to change 'id' to the name of your ID-parameter in the URL
$viewsIncrementQuery = "UPDATE `topic` SET `Views` = `Views` + 1 WHERE `id` = " . $topicId;
$incremented = mysql_query($viewsIncrementQuery, $epl) or die(mysql_error());
// run/execute mysql query
但现在我希望能够使用链接调用该查询,(点击链接)
我该怎么做
【问题讨论】:
-
首先,格式化你的帖子,它很难阅读。您尝试了哪些方法,哪些方法无效?
-
如果您想留在同一页面上,您需要考虑使用 ajax
-
不重新加载页面?使用 AJAX !
-
通过
_GET发送参数 -
我不打算留在页面上,我只是想确保单击该链接,执行查询,
标签: javascript php html