Jump to content
Fórum Script Brasil
  • 0

Erro na requisição mysql


Tato..

Question

Gente, estou usando o seguinte código:

$cont = mysql_query("SELECT * post WHERE pagina=$idpag")
        or die(mysql_error());
    while($post=mysql_fetch_array("$cont")){
        $id=$post['id'];
        $titulo=$post['titulo'];
        $texto=$post['texto'];
        $id_autor=$post['id_autor'];
    }
    echo ('$id, $titulo, $texto, $id_autor');

e ele me reporta o seguinte erro:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'post WHERE 'pagina'=1' at line 1.

Alguém sabe me dizer aonde eu errei? hehehe

Obrigado desde já!!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...