Delete database record [closed]

-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 phpmyadmin directly and gave the following error:

  

Unknown column 'convocation.entity_name' in 'where clause'

if you run:

$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 should be there.

Calling table:

Tableata:

    
asked by anonymous 12.04.2016 / 02:17

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
    
12.04.2016 / 03:19