I am working on a live chat function, I have everything working except the message retrieval and displaying function, I am storeing all the messages on my server in a table, I am trying to make a function now to retrieve the most recent message entered and display it in the chat box. I am new to ajax, so I am styill figuring it all out, I can make the function to pull the information out using PHP but I am having trouble making the function to display the information without refreshing the page and allow for the scrolling. The place the information I want to be displayed is called "chatBox" and the table I am pulling from is called "chatRoom" if anyone is willing to help me out with this I would appreciate it very much.

wow, so many views and so few coments on any aspect of my question. Thanks for everyones time, I will close this thread now and try to do it on my own again.

I think that your question is a little too vague because you didn't post any code to demonstrate exactly what you're trying to do. For example, you wrote that you have the function to pull the information out using PHP. Does this mean that you have the PHP function, or you have a Javascript function that retrieves data from a PHP page?

Also, what is the schema of the results like? Is it JSON? XML? HTML? etc.

Ajax is a little confusing to me I am not sure what code would be benificial to anyone trying to answer this question, I can post the php code to retrieve the information, but it is just the mysql_query(SELECT) lines, that tells noone anything, I stated in the question that the area that the results will be displayed is called chatBox and the data is coming from the chatRoom table on the DB, other then that I have no clue what would help. I could post the code for the client end of the chat function, but every time I have seen ajax it only refers to the origin of the information and the destination, I am not sure what code to give, thats why I said that I'm new to ajax, hoping someone would tell me what is needed to come up with the propper solution, thats how I got to know what to post in the PHP area.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.