Tag: mysql

使用Jquery Ajax从Mysql中检索数据

list.php :一个简单的ajax代码,我只想显示Mysql表的记录: $(document).ready(function(){ var response = ”; $.ajax({ type: “GET”, url: “Records.php”, async: false, success : function(text) { response = text; } }); alert(response); }); Let jQuery AJAX Change This Text Get Records Records.php是从Mysql获取记录的文件。 在数据库中只有两个字段:“名称”,“地址”。 Name: Address: <?php while ($row = mysql_fetch_array($result)) { echo "”; echo “$row[1]”; echo “$row[2]”; echo “”; } ?> 此代码无效。