Click here to Skip to main content
15,886,783 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all...
i have a chat table like this
HTML
id    msg      firstname    lastname
1      hi       rams         var
2      hello    rams         var
3      hi..     var          rams
4      h r u?   rams         var
5      m fin    var          rams
6      h abt u? var          rams
7      gud      rams         vat

here i need to get result like
plain
rams:hi hello
var: hi
rams:h r u?
var m fin h abt u?
rams:gud

for this i have written query like:
SQL
select concat(firstname,':',msg,'<br />) as msg from chattbl group by firstname order by id asc

it results:
plain
rams:hi 
var: hi

but here i need to concatinate all the data according to firstname of above table if i use group_cancat function here it limits the results set up to some limit but here user input may not have limitation .
can any one please help me....
thanks in advance....
Posted
Updated 4-Apr-12 20:18pm
v5
Comments
Mario Majčica 4-Apr-12 9:20am    
Why do you need to do that on SQL side? it will be easier to do it server side.
tulasiram3975 5-Apr-12 0:14am    
of course but i need to reduce lines of code that's Why..!!! we can't do it in mysql?
tulasiram3975 5-Apr-12 1:09am    
can you give logic for server side..
tulasiram3975 5-Apr-12 2:20am    
I was Done BY Server Side Code finally...

1 solution

i was failure from taking mysql so that i simply written code for server side
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900