My addresses are stored in 5 fields addr_1 to addr_5. When I display an address I want to show each field on a new line but without blank lines.
So I do
SELECT concat_ws(',',addr_1,addr_2,addr_3,addr_4,addr_5) as fulladdr
//Then to get rid of repeating commas
$full = preg_replace('/,+/', ',', $recs[fulladdr]);
//Then change the commas to <br />
$full = $recs[parent]."<br />".str_replace (",", "<br />", $full );
This works on my test machine running PHP Version 5.0.5-2ubuntu1
But not on my production site running PHP Version 5.3.26
Any idea why this doesn't work?
I initially tried doing concat_ws("<br />"... but couldn't work out the reg expression to search for <br />
Mike