SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Display Data

  1. #1
    SitePoint Wizard rctneil's Avatar
    Join Date
    Jun 2005
    Posts
    1,890
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Display Data

    For some reason i get an error when using this code. It is to do with the part about email i'm sure:

    PHP Code:
    <?php

    $noreviews 
    "No Reviews are available for "$getridedata['ridename'] ." at this time.";

    $query "SELECT * FROM atm_visitreviews WHERE rideid='" $_GET['rideid'] . "' AND authorised='Yes'"
    $result mysql_query($query) or die(mysql_error()); 


    while(
    $row mysql_fetch_array($result)){ 
        echo 
    "<fieldset><legend><a href=/"mailto: . $row['email']/">" $row['name'] . "</a></legend><blockquote>" $row['reviewtext'] . "</blockquote></fieldset>"
         echo 
    "<br />"
    }


    if (
    mysql_num_rows ($result) == 0) {
            echo 
    $noreviews;
        }
    ?>
    Thanks

    Neil

  2. #2
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please post the error you get. It saves a ton of time to know where.

  3. #3
    SitePoint Addict
    Join Date
    Apr 2004
    Location
    Belgian in Mexico
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem is with your "href" attribute quotes and quotes escaping.
    Replace
    PHP Code:
    "<fieldset><legend><a href=/"mailto: . $row['email']/">" 
    by
    PHP Code:
    "<fieldset><legend><a href=\"mailto:" $row['email'] . "\">" 
    or (with single quotes):
    PHP Code:
    "<fieldset><legend><a href='mailto:" $row['email'] . "'>" 
    Regards,

    MichaŽl
    MichaŽl Niessen
    http://assemblysys.com
    (Countries/states/cities with latitude & longitude,
    weathercodes & topical databases)


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
  •