0

我的 HTML 文件:

<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<script>
var session;
$.ajaxSetup({cache: false})
$.get('ajax2.php');
</script>
</body>

我的 ajax2.php 文件

mysql_connect("localhost", "root", "root") or die(mysql_error());
mysql_select_db("final") or die(mysql_error());
mysql_query("UPDATE `final` SET `phone_number` = `phone_number` + 1 WHERE `name` = 'gerg' ");

当我运行 ajax2.php 时,它工作得很好(将值增加 1)。但是我无法通过 ajax.html 访问。我的错误在哪里?谢谢你。

4

1 回答 1

0

尝试在文件名前加一个斜杠:

$.get('/ajax2.php');
于 2013-08-31T23:05:35.593 回答