i keep running into this and been working on it for 2 months and still can't figure it out

Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/under/public_html/kp/includes/inc-setup.php on line 16

<?php

//include( $incloc . "includes/inc-config.php" );

class mysql {
    function connect()
    {
        //global $DB_INFO;
define('DB_NAME', 'under_rebels');
        $connect = mysql_connect("localhost", "under_nocause", "buttercream");
        mysql_select_db(DB_NAME, $connect);
        if ( !$connect ) {
            die("Cannot connect to mySQL Host.");
        }  
} $query = ('SELECT * FROM DB_NAME'); $results = mysql_query($query) or die('Query failed: ' . mysql_error()); function query( $results ) { return mysql_query( $results ); } function fetch( $results ) { return mysql_fetch_array( $results ); } function num( $results ) { return mysql_num_rows( $results ); } function affected() { return mysql_affected_rows(); } function close() { return mysql_close(); } } $db = new mysql; $db->connect(); $mintime15 = time() - ( 60 * 15 ); $timeminus24 = time() - ( 60 * 60 * 24 ); $gamedate = date( "d-m-Y - H:i:s" ); $result = $db->query( "SELECT * FROM settings" ); while ( $rowz = $db->fetch( $result ) ) { $x1 = $rowz['sName']; $x2 = $rowz['sValue']; $SETTINGS[$x1] = $x2; } ?>

line 16:

$query = ('SELECT * FROM DB_NAME');

    Your class construction is wrong. You can't put statements outside of functions in a class declaration, only variable declarations.

      ummm...........english plz i am not that good with php

        That is English. If your not good with php you need to learn it not English. Read this.

          php -r "Your class construction is wrong. You can't put statements outside of functions in a class declaration, only variable declarations."
          
          Parse error: parse error, unexpected T_CLASS in Command line code on line 1
          
            Write a Reply...