harlequeen Posted July 12, 2008 Share Posted July 12, 2008 Hi I am trying to get a name to echo to the screen using the following code. echo ($myrow["Firstname"].$myrow ["Surname"]); but this does not allow me to put a space in between the two names. I have tried adding a space after the field name "Firstname" or before "Surname" but this does not work. (presumably because the field names are different then?) How do I do this please? regards Harlequeen Quote Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/ Share on other sites More sharing options...
JasonLewis Posted July 12, 2008 Share Posted July 12, 2008 Like so: echo $myrow['Firstname']." ".$myrow['Surname']; Quote Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/#findComment-588416 Share on other sites More sharing options...
harlequeen Posted July 13, 2008 Author Share Posted July 13, 2008 Thanks, I thought I had tried all the combinations of "" and spaces I could think of. Cheers Harlequeen Quote Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/#findComment-588920 Share on other sites More sharing options...
.josh Posted July 13, 2008 Share Posted July 13, 2008 or you can do this: echo "{$myrow['Firstname']} {$myrow['Surname']}"; I'm kind of surprised you didn't at least do this though: echo $myrow['Firstname']; echo " "; echo $myrow['Surname']; Quote Link to comment https://forums.phpfreaks.com/topic/114431-solved-concatenation/#findComment-588932 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.