expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR [SOLVED]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
duk
Forum Contributor
Posts: 199
Joined: Wed May 19, 2004 8:45 am
Location: London

expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR [SOLVED]

Post by duk »

i realy can't find the problem, maybe its easy and im realy tired...

can someone help me here ??

Code: Select all

class Permissions {
  function get_perm($user_id) {
       
     $sql = "select user,admin,superuser from permissions where id='$user_id'";
     $exec_sql = mysql_db_query(DB_NAME, $sql);
     $result = mysql_fetch_row($exec_sql);
   if ($result[0]) {
     $user_perm = $result[0];   
     $admin_perm = $result[1];
     $superuser_perm = $result[2];
   
     if ($superuser_perm == 1) {
         return 3;
     } elseif ($admin_perm == 1) {
         return 2;
     } elseif ($user_perm == 1) {
        return 1;
     } else {
        return 0;
     }
   } else {
        return 0;    
  }          
 } // function 
}      
?>
i need to include this class in another script that where i see the error, but if hi just simply run this in the browser i get this:

Parse error: syntax error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in c:\program files\apache group\apache\htdocs\permissions.inc.php on line 34

it should be blank page... ???

***EDIT***
solved dind't do nothing but next day with a reboot to the machine start working perfectly...
Last edited by duk on Tue Jan 17, 2006 7:12 am, edited 2 times in total.
duk
Forum Contributor
Posts: 199
Joined: Wed May 19, 2004 8:45 am
Location: London

Post by duk »

is a litle bit strange... im now in home and works perfectly...
Post Reply