Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8808493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:38:14+00:00 2026-06-14T02:38:14+00:00

I have developed a random chatting system like omegle.com using jQuery, PHP/MySQL but I

  • 0

I have developed a random chatting system like “omegle.com” using jQuery, PHP/MySQL but I want to improve the site. At the current stage, it sends a request to PHP file for displaying new messages. The jQuery code is below

function load_msg(){

   $.ajax({
        url: 'show_msg.php',
        success: function(result){
            $("#wait").css("display","none");  
            $("#chat_canvas").html(result);
        }
    });

}

setInterval("load_msg()",3000);

But it displays all messages, I want to be able to display only new message.But I could not understanding how to do that.

I am giving an example,

suppose I have written in the text area “Hello xyz”.
it will send the message “Hello xyz” to a php file, and the php file will store it in database. Next this message is displayed via sending a request to a php file and it returns the result. As a result it displays “Hello xyz”. This is ok. But If I send “How are u? “, then it will load both
“Hello xyz” and
“How are u?”. I dont want to load “Hello xyz” over again,coz it has been already loaded before. I want to load only new message, that has not been already loaded. How can I do that???

I am sorry for my poor english, english is not my mother tongue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:38:15+00:00Added an answer on June 14, 2026 at 2:38 am

    You could add another column to the table that specifies (by boolean value) whether or not the message has been displayed yet. For example, when the second PHP file makes a request to get the messages, it could set that column to 1 (where 1 = displayed) for each column it just sent to the client, and ignore every column that is already set to 1.

    To elaborate, you may have a query like this that updates that row in the database where all terms are met (to make sure it’s being displayed to the correct client). Afterwards, you could get all affected rows and then return them on the page (which is then retrieved by the Javascript and displayed to the client).

    UPDATE `table` SET `displayed` = 1 WHERE /* search terms here */
    

    The important part is to get all of the affected, preferrably using PDO or mysqli.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a website using Razor (Microsoft WebMatrix) and now I want to
I have developed a GUI for a random application using WPF. I have a
I have developed a Java server using Eclipse that accepts TCP socket connection from
I have developed an app that in testing has worked fine but when it
I have developed a Facebook application using Flash as3. In this application when ever
I have developed an app and its written in PHP (with a bunch of
Hye guys, I have created jquery ajax file uploader, but I have one problem
I have developed an app and have been using Monkey to test it. My
I have a VS2008 C++ application for Windows XP SP3 developed using WTL 8.1.
So I have been playing around with the facebook like button but I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.