Parse error: syntax error, Unexpected ','

Asked

Viewed 292 times

0

line error:

$config = new Config;

$strqury = "SELECT * FROM ", $config->ContasTable , " WHERE Login = ? AND ", $config->PasswdColumn ," = ? AND ", $config->CheckemailColum ," = ?";
echo $strqury;

Class config:

Class Config{

    public $NameGC = 'Grand Chase SkelletonX'; #Nome do Servidor

    public $ContasTable = 'accounts'; #Nome da tabelas das contas
    public $LoginsColumn = 'Login'; #Nome da Coluna dos Login
    public $PasswdColumn = 'Passwd'; #Nome da Coluna do Passwd
    public $CheckemailColum = 'CheckEmail'; #Nome da coluna do checkemail
}

my error: Parse error: syntax error, Unexpected ','

1 answer

4


Use stitch . for concatenate in PHP and not the comma ,:

$strqury = "SELECT * FROM ". $config->ContasTable ." WHERE Login = ? AND ". $config->PasswdColumn ." = ? AND ". $config->CheckemailColum ." = ?";
  • Thanks @Felipe, I stopped working a while with php I had forgotten about the .

  • @William if you solve the problem, do not forget to mark the answer as right, to help other people with the same problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.