...

View Full Version : Code Troubleshooting



nick.elliott10
10-17-2011, 08:13 PM
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: -


echo "<a href=\"news.php?barcode=" . $row[newsID] . "\">"$row['newsTimestamp']"</a>";

Can anyone see what the problem is?

Thanks in advance.

Old Pedant
10-17-2011, 08:29 PM
This is 100% a PHP question, nothing to do with MySQL.

But here:


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']

nick.elliott10
10-17-2011, 08:37 PM
Thanks Old Pedant! It now works.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum