note 100609 rejected from function.ibase-query by danbrown
| From: | danbrown@php.net | Date: | Tue, 26 Oct 2010 23:31:12 +0000 |
| Subject: | note 100609 rejected from function.ibase-query by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173484@lists.php.net to get a copy of this message | ||
Note Submitter: ksn7 at ymail dot com
----
Hello, I have a problem with ibase_query and do not know what to do, have run behind several
solutions but none had the success expected. I wonder why giving the error:
Dynamic SQL Error SQL error code = @ 1 Token unknown - line @ 1, column 2 @ @ 1
This occurs when I try to change the data. When I try to delete already appears another error:
conversion error from string "@ 1" in
CODE:
operacoes.php
<?php include ("conexao_fb.php");
$acao = $_POST["acao"];
$cod = $_POST["codigo"];
$nome = $_POST["nome"];
$endereco = $_POST["endereco"];
$cidade = $_POST["cidade"];
$estado = $_POST["uf"];
if ($acao=="Inserir")
{
$sql = "INSERT INTO CADASTRO
(nome, endereco, cidade, uf)
VALUES
('$nome',
'$endereco',
'$cidade',
'$estado')";
ibase_query($sql) or die("Não foi possível inserir dados");
print "<script type = 'text/javascript'> location.href =
'index.php?pagina=3'</script>";
}
if ($acao=="Alterar")
{
$sql= ("UPDATE CADASTRO SET
nome ='$nome',
endereco = '$endereco',
cidade='$cidade'
uf='$estado' WHERE CODIGO='" .$cod. "'");
$resultado = ibase_query($sql)
or die (ibase_errmsg());
print "<script type = 'text/javascript'> location.href =
'index.php?pagina=3'</script><br>";
}
if ($acao=="Excluir")
{
$sql = ("DELETE FROM CADASTRO WHERE CODIGO='" .$cod. "'");
ibase_query($sql) or die("Não foi possível excluir dados");
print "<script type = 'text/javascript'> location.href =
'index.php?pagina=3'</script>";
}
?>
Please, HELP ME!!!