mardi 4 août 2015

concatenate query result in a string

I am getting a db result as 3 rows (Please see image link below).

enter image description here

The sql statement used is

select tevmkt.ev_mkt_id, tevmkt.name, tevmkt.ev_id, tevoc.ev_oc_id, 
       tevoc.desc, tevoc.fb_result, tevoc.lp_num, tevoc.lp_den, 
       tev.start_time
from tevmkt, tev,tevoc
where tevmkt.name = '|Match Result|' and tev.ev_id=tevmkt.ev_id and 
      tevoc.ev_mkt_id=tevmkt.ev_mkt_id and tev.start_time>=Today;

I will like to use php to concatenate each of the 3 rows into string or maybe use SQL statement.

So, the first 3 rows will display as ;

632274|Match Result||Draw||Aldershot Town||Arsenal FC|

And the next 3 rows

637799|Match Result||Draw||Southend United||Oxford United|

Aucun commentaire:

Enregistrer un commentaire