SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: fast Q

  1. #1
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fast Q

    whats wrong with this

    PHP Code:
     echo '<tr><td>$article_name</td><td>$date_added</td><td>$status</td><td><a href="read1.php?article_ID=$articleid">View</a></td></tr>'
    it does not fatch the article id

    when i do

    echo $articleid;

    it display article id


    help please
    Never be shy to ask silly Qs
    An answer is always better than none

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Variables are not parsed in strings enclosed by single quotes. Use double quotes.

  3. #3
    SitePoint Guru hisham777's Avatar
    Join Date
    Dec 2005
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks
    i used it in this way
    PHP Code:
        echo "<tr><td>$article_name</td><td>$date_added</td><td>$status</td>
        <td><a href='read1.php?article_ID=
    $articleid''>View</a>";
        
        echo 
    "</td></tr>"
    Never be shy to ask silly Qs
    An answer is always better than none

  4. #4
    Obey the Purebreed trib4lmaniac's Avatar
    Join Date
    Dec 2004
    Location
    Cornwall, UK
    Posts
    594
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aside from the double apostophe towards the end of the first line which would generate invalid HTML, that's fine


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
  •