Delete function in PHP with mysql

Asked

Viewed 125 times

0

I have the following line:

mysqli_query($connected,"DELETE FROM itenspauta Where Coditem=$received");

But it excludes the whole row, and I just wanted to delete only one column from this table. Following table: Tabela

I wanted to delete only the forwarding column when prompted. someone has tips?

  • 1

    And what would that be, a "hole" in it? What you can do, which makes more sense, is an UPDATE to empty value. UPDATE tabela SET coluna = "" WHERE id=id_da_linha_desejada;

  • "But it excludes the whole line", yes, that’s exactly what I command delete makes, deletes a row. There’s no way to delete a column the way you’re thinking, you can leave it with the value null if it allows. Deleting a column means changing the table and deleting the entire column with all values

  • Thanks a lot guys, it was really what I needed, I managed to do here.

  • @Vitormatheus resolved, it would be nice to post below, as a response, and mark as solved.

  • mysqli_query($connected,"UPDATE itenspauta SET forwarding='' Where Coditem=$received");

  • I resolved it this way above, ^^

Show 1 more comment
No answers

Browser other questions tagged

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