Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

valramos

[Resolvido] Erro Unexpected character

Recommended Posts

Galera to fazendo uma consulta php e mysql

e ta apresentando o erro: Warning: Unexpected character in input: '\' (ASCII=92) state=1

 

vou postar o codigo:

mysql_connect($host, $user, $pwd)
or die("Falhou o acesso ao banco");

mysql_select_db("$base")
or die("Falhou ao selecionar a base");

$query = "SELECT table.*, table2.matricula, table2.ano,table2.senha,table.ano
         FROM table2 INNER JOIN table ON table2.matricula = table.matricula
         WHERE table2.matricula = \"$matricula"\
         AND table2.ano=\"$ano"\
         AND table.ano=\"$ano"\";

como se a barra estivesse errada!

Abraço

Compartilhar este post


Link para o post
Compartilhar em outros sites

faz o seguinte:

 

$query = "SELECT table.*, table2.matricula, table2.ano,table2.senha,table.ano
         FROM table2 INNER JOIN table ON table2.matricula = table.matricula
         WHERE table2.matricula = '$matricula'
         AND table2.ano='$ano'
         AND table.ano='$ano'";

Compartilhar este post


Link para o post
Compartilhar em outros sites

velew pela dica usei o like e funcionou legal

postar o codigo que fiz pra quem precisar!

 


$query = "SELECT * FROM $table, $table3 ,$table2
         where $table.matricula like \"$matricula\"
         and $table2.senha like \"$password\"
         and $table.ano like \"$ano\"
         and $table2.ano like \"$ano\"
         and $table3.codigo = $table.codmat
         and $table2.matricula = $table.matricula";


Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.