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
    New Coder
    Join Date
    Oct 2011
    Location
    Cambridgeshire, UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Code Troubleshooting

    I am getting the following parser error from my code:

    Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in C:\wamp\www\cromwellcc.org.uk_new\index.php on line 244.

    My code on line 244 is: -

    PHP Code:
    echo "<a href=\"news.php?barcode=" $row[newsID] . "\">"$row['newsTimestamp']"</a>"
    Can anyone see what the problem is?

    Thanks in advance.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,189
    Thanks
    75
    Thanked 4,341 Times in 4,307 Posts
    This is 100% a PHP question, nothing to do with MySQL.

    But here:
    Code:
    echo "<a href=\"news.php?barcode=" . $row['newsID'] . "\">" . $row['newsTimestamp'] . "</a>";
    You used the period (concatenation operator) correctly around $row['newsID']
    You just needed to do the same thing around $row['newsTimeStamp']
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New Coder
    Join Date
    Oct 2011
    Location
    Cambridgeshire, UK
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Old Pedant! It now works.


  •  

    Posting Permissions

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