1

I have been getting an error saying unexpected T_STRING on line 2 of this script:

<? php
session_start();
$incidentKey = $_SESSION['incidentKey'];
$incidentDetailsQuery = mysql_query("SELECT * FROM incidents WHERE incidentKey='".$incidentKey."'");
while ($incidentDetails = mysql_fetch_assoc($incidentDetailsQuery);
?>

And despite looking through the forum heaps, I have had no luck. This was even coming up as an error saying unexpected T_STRING on line 2 when I the code started like this:

<? php
$incidentKey = $_SESSION['incidentKey'];
etc.....

I've gone through all other includes and couldn't find any missing terminators leading up to this script. Can anyone think why else I would be getting this error?

4
  • 2
    <? php remove the space to make it <?php Commented Nov 10, 2014 at 8:32
  • 2
    It's the space after <? php. Change it into <?php Commented Nov 10, 2014 at 8:32
  • Thank's guys, I had no idea that space made a difference!! Commented Nov 10, 2014 at 8:38
  • @roullie submit it as an answer so the question is not marked unanswered. user2034544 accept the answer once submitted. Commented Nov 10, 2014 at 9:00

1 Answer 1

1

Remove the space in

  <? php 

to make it

  <?php
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.