|
Re: Combine 2 Db Columns with an Array?: msg#01954php.general
On 13 May 2002, PHP User wrote: > I am trying to find the best way to combine 2 columns in a MySQL Db call into > one by using an array. I?ve tried array_push, implode, explode, array_merge > and > extract all with no luck. I feel I am close but have read all I can and still > am > hitting a dead end. > I need to select a Title and Alternate title from a table, and then list the > results by BOTH the Title and Alternate Title. So the list that gets echoed > out > would be a combined array of the Title column and the Alt_Title column. The > idea > is to have each item listed twice, once by it?s title and once by it?s > alternate > title. > I can not find a way to merge the 2 separate columns. > Here?s what I?m trying to do: > > $result = mysql_query("SELECT Title, Alt_Title, Size, Price, More, Comment > ORDER BY title"); select concat (title, ' (', alt_title, ')') as title, size, price, more, comment from table order by title; miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Genus who came up with "Self Destruct Code" & "Copy Pro tection", Miguel Cruz |
|---|---|
| Next by Date: | Re: Need help with Arrays, Miguel Cruz |
| Previous by Thread: | Re: Combine 2 Db Columns with an Array?, Chris Knipe |
| Next by Thread: | Re: Combine 2 Db Columns with an Array?, 1LT John W. Holmes |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |