SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Creating Gaps

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2003
    Location
    UK
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating Gaps

    I am using Dreamweaver MX to create a staff page that extracts data from a MySQL DB. Using Dreamweaver, extracting and displaying the data is fine, however I am having some problems with the formatting of the information.

    I have divided each of the employee's names into their title (Mr, Mrs, Miss etc), firstname and lastname fields. When I place these side-by-side within dreamweaver with spaces in between in the code, they appear bunched together when viewing the result in the browser.

    My code looks like this:

    <?php do { ?>
    <tr>
    <td><?php echo $row_staffrs['staff_title']; ?>
    <?php echo $row_staffrs 'staff_firstname']; ?>
    <?php echo $row_staffrs['staff_lastname']; ?>
    </td>
    <td><?php echo $row_staffrs['staff_room']; ?></td>
    <td align="center"><?php echo $row_staffrs['staff_tel']; ?></td>
    <td><a href="mailto?php echo $row_staffrs['staff_email'];? >"><?php echo $row_staffrs['staff_email'];?></a></td>
    </tr>
    <?php } while ($row_staffrs = mysql_fetch_assoc($staffrs)); ?>
    </table>


    Does anyone know a way to create spaces between the pieces of data so that they display properly? (probably very easy question, but just don't know how).

    Thanks for any help.

    Mark

  2. #2
    SitePoint Enthusiast amherst's Avatar
    Join Date
    Jul 2003
    Location
    London UK
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Griff

    Does anyone know a way to create spaces between the pieces of data so that they display properly? (probably very easy question, but just don't know how).

    PHP Code:
     echo $row_staffrs 'staff_firstname'] . " " $row_staffrs['staff_lastname']; 
    should do it

    Mike
    http://www.riverwise.co.uk
    http://www.thamesbooks.co.uk


  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2003
    Location
    UK
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are a star - thanks Mike!

  4. #4
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    or

    PHP Code:
    echo $row_staffrs['staff_firstname'], ' '$row_staffrs['staff_lastname']; 
    which is 10 nanoseconds faster.
    Mike
    It's not who I am underneath, but what I do that defines me.


Bookmarks

Posting Permissions

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