Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-13-2008, 03:18 PM   PM User | #1
jarv
Banned

 
Join Date: Mar 2007
Posts: 1,523
Thanks: 116
Thanked 0 Times in 0 Posts
jarv can only hope to improve
adding a space between records?

how do i add a space between FirstName and LastName

Code:
  {
  echo "<div class='entry'>" . $row['FirstName'] , $row['LastName'] . "</div>";
  }
jarv is offline   Reply With Quote
Old 05-13-2008, 03:24 PM   PM User | #2
RMcLeod
New Coder

 
Join Date: Mar 2008
Location: Somerset, England
Posts: 93
Thanks: 0
Thanked 10 Times in 10 Posts
RMcLeod is an unknown quantity at this point
PHP Code:
<?php
  
echo '<div class="entry">' $row['FirstName'] . ' ' $row['LastName'] . '</div>';
?>
RMcLeod is offline   Reply With Quote
Old 05-13-2008, 08:23 PM   PM User | #3
JohnDubya
Super Moderator


 
JohnDubya's Avatar
 
Join Date: Nov 2006
Location: Missouri
Posts: 634
Thanks: 12
Thanked 18 Times in 18 Posts
JohnDubya is on a distinguished road
jarv, RMcLeod's example will do what you need, but I wanted to help you understand what it means.

First off, he changed your statement quotes from double to single. For HTML tags, you need to use double quotes around the attributes. So:

PHP Code:
echo '<div class="entry">'

instead of

echo "<div class='entry'>" 
And using periods in between the parts of the echo statement is called concatenation. They basically glue parts of a statement together. So you can glue together the div HTML and the row variables and the space in between. Hope that helps some. Good luck!
__________________
JDub
http://johnnyzone.com/blog
JohnDubya is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:23 AM.


Advertisement
Log in to turn off these ads.