Chat program using line writing method (_php) tutorial

Source: Internet
Author: User
(next to the previous section)










Lt3.php (as the current mainstream development language)
Processing of speaking information

Session_Start ();
Include ("g_fun.php (as current mainstream development language)");
F_connectdb ();

$query = "Select Max (lt_id) as Rmaxid from Lt_t_content";
$res = MySQL (the best combination of PHP collocation) _query ($query, $DBH);
$row = MySQL (the best combination of PHP collocation) _fetch_array ($res);
$maxid = $row ["Rmaxid"];
if (empty ($maxid)) {$maxid = 0;}
$maxid = $maxid + 1;
Add Chat Info
$query = "INSERT into lt_t_content (lt_id,lt_speaker,lt_speaked,lt_secrecy,lt_content,lt_time,lt_face)";
$query. = "VALUES (". $maxid. ",". $username. ",". $towho. ", 1,". $oldsays. ", Now (), 1)";
$res = MySQL (the best combination of PHP collocation) _query ($query, $DBH);

Modify the last chat time to determine if the user exists and prevent the timeout from being deleted
$query = "SELECT count (*) as Rcount from lt_t_online where Lt_username =". $username. ";
$res = MySQL (the best combination of PHP collocation) _query ($query, $DBH);
$row = MySQL (the best combination of PHP collocation) _fetch_array ($res);
$lcount = $row ["Rcount"];
if ($lcount = = 0) {

http://www.bkjia.com/PHPjc/509055.html www.bkjia.com true http://www.bkjia.com/PHPjc/509055.html techarticle body leftmargin= "0" topmargin= "0" div align=center br form method= "POST" action= "lt3.php (as current mainstream development language)" name= "Fyq" target= "BFORLT3" Onsub ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.