0
How can I delete from a table where id= $row['id']. ? From php
firs I do mysqli_query($connect, "SELECT* FROM table"); I put it in an array i.e. $row I echo a table with the datas. I create delete button in each row. What I want to do is: when I click the button in one of the table rows, that row will be deleted. When I try: &datas = mysqli_query($connect, "SELECT* FROM table"); while ($row = mysqli_fetch_assoc($datas)) { //here I make the table in HTML and echo $row elements if(filter_input(INPUT_POST, 'delete')) // the name of button
2 Answers
0
{ mysqli_query($connect, "DELETE id FROM table WHERE id = // and here is where i stucked. if I write $row['id'] I got an error, as soon as I put the [ ] . when I write id= (filter_input(INPUT_POST, 'delete')) it doesn't do anything.
Can someone help and explane what is wrong?
0
Hi Moksh Makhija,
IT'S WORKING!!!!!
Thank you so much! I spent the whole day yesterday to find the solution...
Can you explane the 2 dots and the empty quotation mark?
Am I right when I suppose the dots ar to concatenate? And what about the quotation mark?