Delete record from database

Asked

Viewed 55 times

-1

I’m trying to run the following line:

 $sqld = "delete FROM ata where convocatoria.nome_entidade='$ent'   and convocatoria.cod_convocatoria=ata.cod_convocatoria";
 mysql_query($sqld);

I tried direct on phpmyadmin and gave the following error:

Unknown column 'convocatoria.entity' in 'Where clause'

run out:

$sqld = "select * FROM ata,convocatoria where convocatoria.nome_entidade='Spa'     and convocatoria.cod_convocatoria=ata.cod_convocatoria ";
mysql_query($sqld);

It works but it does select * from convocatoria, the problem in delete must be there.

Table call:

inserir a descrição da imagem aqui

Table minutes:

inserir a descrição da imagem aqui

1 answer

1


I searched the phpMyAdmin manual and found the solution:

DELETE ata, convocatoria FROM ata INNER JOIN convocatoria 
WHERE convocatoria.nome_entidade='sdasd' 
  AND convocatoria.cod_convocatoria=ata.cod_convocatoria

Browser other questions tagged

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