1

So I wrote a PHP script to communicate to MySQL. And I am trying to get all photos in the table.
But It keep throwing me this parse code

"Parse error: syntax error, unexpected '$sPhotos' (T_VARIABLE)" on this statement below:

$sPhotos = $GLOBALS['CPhotos']->getAllPhotos();

I am a lost I'm not missing any semi-colons and I have CPhotos in the script as

require_once 'php/CPhotos';

Am I calling the function getAllPhotos wrong?

All lines of code above $sPhotos = $GLOBALS['CPhotos']->getAllPhotos(); line.

<?php 
   require_once 'php/CMySQL.php';
   require_once 'php/CMembers.php';
   require_once 'php/CPhotos.php';

    // get login data
    list ($sLoginMenu, $sExtra) = $GLOBALS['CMembers']->getLoginData();

    // get all photos
     $sPhotos = $GLOBALS['CPhotos']->getAllPhotos();
user3900101
  • 53
  • 1
  • 7
  • Please show the code above this line! – Rizier123 Mar 27 '15 at 18:49
  • That usually means a missing bracket or semicolon somewhere – sbatson5 Mar 27 '15 at 18:51
  • As shown in your error, could be missing `;` right above this line. Show what content you have before this line – bcesars Mar 27 '15 at 18:53
  • Please reference this question - http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php Also, you should STRONGLY consider using an IDE that highlights such syntax errors for you. Voting to close as the problem here is undoubtedly a simple syntax error. – Mike Brant Mar 27 '15 at 18:57

0 Answers0