473,387 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Chat code

92
Hi all,
can anyone suggest me, how to create my database for chat code as like gtalk.

msgid
user1
user2
date
time
msg
msgby

but i cant display their messaged data as

user1:hi
user2:how r u?
user1:i m fine, what abt u?

I dont knw how to fetch their data

now my code displaying

on user1 window


user1:hi
user1:i m fine, what abt u?

on user2 window

user2:how r u?

Anyone help me plz

Thanks in Advance
Feb 25 '10 #1
3 1546
Atli
5,058 Expert 4TB
Hey.

What have you tried so far?
This looks like a fairly straight-forward SELECT to me. You just need to select rows where the user fields match with the users that are supposed to be a part of the chat.


Also, there is a better way to design the database, but it is a lot more complicated. I wouldn't suggest it until you have a good understanding of how to do SELECTs, as it involves multiple table joins.

In essence, it looks something like this:
Expand|Select|Wrap|Line Numbers
  1. +------+    +------------+    +--------------+
  2. | user |    | user_convo |    | conversation |
  3. +------+    +------------+    +--------------+
  4. | id   |>-| | convo_id   |>|->| convo_id     |
  5. | name |  |>| user_id    | |  | created      |
  6. +------+  | +------------+ |  +--------------+
  7.           |                |
  8.           | +------------+ |
  9.           | | message    | |
  10.           | +------------+ |
  11.           | | msg_id     | |
  12.            \| user_id    | |
  13.             | convo_id   |/
  14.             | text       |
  15.             | sent_at    |
  16.             +------------+
But like I say, the SELECTS for this database would be far more complex than the one you are dealing with now.
Feb 26 '10 #2
Limno
92
Hi Alti,

Can you give me any send me any sample code, so that i can understand how to do this project...

Thanks in Advance
Feb 26 '10 #3
Atli
5,058 Expert 4TB
Why don't you start by showing us what you have done so far. You say you had already made code that partially showed what you wanted it to? Show us how that looks and we will move on from there.

And please, post "snippets" (the important parts) of the code. - People tend to want to post every single line; sometimes hundreds of them. That is not necessary. We only need the parts that have anything to do with the problem. Thanks :)
Feb 26 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Scott Nonnenberg [MSFT] | last post by:
C# Chat: The C# IDE "Expansions, enhanced intellisense, type colorization, refactoring, improved code navigation, metadata as source, Edit and Continue! So many new features, you'll want to make...
0
by: Eric Sassaman [MS] | last post by:
Online Chat: Upgrading COM Applications to .NET with Visual C++ 2005 Many applications consume and expose COM interfaces as their object models today. And .NET has tools such as tlbimp, tlbexp...
0
by: Eric Sassaman [MS] | last post by:
Online Chat: Upgrading COM Applications to .NET with Visual C++ 2005 Many applications consume and expose COM interfaces as their object models today. And .NET has tools such as tlbimp, tlbexp...
3
by: A | last post by:
Hi all! I am currently working on a project where I need to create a web-based chat application that will be used for auctions. If possible, could I get some advice on how to create chat...
0
by: HaggardSmurf | last post by:
Alright well I had a question before when i was a noob and posted here and got such a great response this has become my main vb site. Anyways I have a comp that cant run msn due to it being a piece...
8
by: Bllich | last post by:
Greetings, there is a nice multi-user chat application written by Microsoft in VB which code is on the location: http://download.microsoft.com/download/c/4/8/c488a081-85f2-4a2e-a121-...
0
The1corrupted
by: The1corrupted | last post by:
Alright, I've set up a chat system that only works half way... I need suggestions on how to make it work better... I'm trying to figure out a way to make $_SESSION viewable to all players by...
1
oll3i
by: oll3i | last post by:
how do i run this example ? with openjms package com.ociweb.jms; import java.io.*; import javax.jms.*; import javax.naming.*;
1
oll3i
by: oll3i | last post by:
when i run it from bat (@start "CHAT to topic" run Chat)without durable subscriber the window for chat opens but when i added the durable subscriber to the code it stopped opening? import...
3
by: John Dalberg | last post by:
I am looking for an asp.net based chat software. I have looked at some (asp.net and php based) and they consist usually of a javascript piece where the web user (visitor) initiates a chat from a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.