DB formatting question

BigToque

Lifer
Oct 10, 1999
11,700
0
76
I have peoples names in 2 fields (F_Name and L_Name).

How can I select this data and display it under one heading?

SELECT Players.F_Name (what goes here) Players.L_Name Player
FROM Players
 

ttown

Platinum Member
Oct 27, 2003
2,412
0
0
i believe you're looking for the double-pipe (or is it single-pipe?) "|"

it might be db specific, so tell us what your db is if that doesn't work
 

WannaFly

Platinum Member
Jan 14, 2003
2,811
1
0
typically it would be a '+' (MSSQL), a '&' for mySQL (i think), or a '|' as ttown mentioned.
 

BigToque

Lifer
Oct 10, 1999
11,700
0
76
Originally posted by: mugs
What are you developing this database in? Access? MySQL?

MySQL

I have a field called F_Name and a field called L_Name in the table "Players"

I know I can use:

SELECT Players.F_Name, Players.L_Name
FROM Players

and the results are displayed under their own field name. But, if I do this:

SELECT Players.F_Name & Players.L_Name Player
FROM Players

It displays the heading properly, but all the results become set to zero as opposed to a concatenation of the 2 strings.
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
You doing this in PHP? Why not just combine them in your PHP code rather than the MySQL query?

Use this to do it in MySQL:
SELECT CONCAT(Players.F_Name, " ", Players.L_Name Player
FROM Players
 

Firus

Senior member
Nov 16, 2001
525
0
0
Originally posted by: mugs
You doing this in PHP? Why not just combine them in your PHP code rather than the MySQL query?

Use this to do it in MySQL:
SELECT CONCAT(Players.F_Name, " ", Players.L_Name Player
FROM Players


This works...