Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    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>";
      }

  • #2
    New Coder
    Join Date
    Mar 2008
    Location
    Somerset, England
    Posts
    93
    Thanks
    0
    Thanked 10 Times in 10 Posts
    PHP Code:
    <?php
      
    echo '<div class="entry">' $row['FirstName'] . ' ' $row['LastName'] . '</div>';
    ?>

  • #3
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •