目前我是这"/> 目前我是这">

php-聊天页面自动输出数据库记录,ajax怎么来用

WBOY
Release: 2016-06-02 11:32:47
Original
920 people have browsed it

php

假如我的页面是这样,很简单


require_once '../config.php';
require_once '../class/DB.class.php';
$db = new DB(HOST, UNAME, UPWD, DBNAME, "utf-8");
/*********************取出数据库的前40条记录 **************************/
$sql = "select * from sendmes order by _second desc limit 0,40";
$result = $db->fetchAll($sql);
foreach ($result as $val){
echo $val["_name"].$val["_mood"]."对".$val["_target"]."说道:
".$val["_content"].""."
";
}
?>

目前我是这样来刷新的:

怎么用ajax实现页面不刷新页面,显示最近记录

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!