Huszar Gellert
Huszar Gellert

Reputation: 33

PHP Unexpected end of file

I ran it trough multiple paranthesis/bracket checkers couldnt find anything wrong im lost :(

  function kepmentes(){
    $db = new MyDB();
    if(!$db){
        echo $db->lastErrorMsg();
    } else {
      $id= getid();
      $kep="kepek/" . $id . ".jpg";
      move_uploaded_file($_FILES["file"]["tmp_name"], $kep);
      $sql =<<<EOF
            INSERT INTO Kepek (KepNev,TID) VALUES ('$kep', $id);
EOF;  
      $ret = $db->exec($sql);
      $db->close();
    }

}

Upvotes: 1

Views: 486

Answers (1)

rjdown
rjdown

Reputation: 9227

You appear to have some spaces after your heredoc closing identifier.

From the manual:

It is very important to note that the line with the closing identifier must contain no other characters, except a semicolon (;). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon.

Upvotes: 2

Related Questions