0
$rows = ( "SELECT * FROM `client` WHERE `clientid` = '".$_SESSION['clientid']."' LIMIT 1" );
$result1 = ( "SELECT `serverid`, `ipid`, `name`, `game`, `status`, `online`, `slots`, `type`, `port` FROM `server` WHERE `clientid` = '".$_SESSION['clientid']."' ORDER BY `serverid`" );
$servers = array( );
while ( $rows1 = ( $result1 ) )
{
    if ( !empty( $rows1['ipid'] ) )
    {
        $rows2 = ( "SELECT `ip` FROM `ip` WHERE `ipid` = '".$rows1['ipid']."' LIMIT 1" );
        $rows1 = ( $rows1, $rows2 );
    }
    ( $servers, $rows1 );
}

so, i'm getting this error:

Parse error: syntax error, unexpected ',' in /path/to/index.php on line 10

live 10 is this one:

$rows1 = ( $rows1, $rows2 );

my friend gave me this php application so i'm not really familiar with the problem.

4
  • 1
    Hello, your post needs some more information. What is the code of index.php? Commented Mar 26, 2020 at 8:59
  • 1
    Why are there round braces around almost everything to begin with …? Was this written by someone mostly familiar with a different lange that requires such a syntax? Commented Mar 26, 2020 at 9:04
  • 1
    Seriously, what are you trying to here? You make $row1 a string; make $result a string; make $row1 equal to $result in an if statement; if an array element of the string $row1 is filled (it isn't) fill $row2 with a string; then start wrapping these strings in brackets separated by commas. Are you aware no SQL query has actually been performed anywhere? Commented Mar 26, 2020 at 9:08
  • actually i have no idea what my friend tried here, he just gave me this application. Commented Mar 26, 2020 at 9:11

1 Answer 1

2

PHP doesn't support to union two expressions inside brackets:

$rows1 = ( $rows1, $rows2 );

So, it should be

$rows1 = new Array( $rows1, $rows2 );

or

$rows1 = $rows1.$rows2;
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.