1

looking for a little help, Im tring to write a search and delete code in php for databases

i need to do a search in a database and delete all found items "rows" what i have been do is calling the table one by one and deleting the affected row. im thinking there has to be a better way then this??

if you have any ideas this would be greatful

cheers thanks

user3408291
  • 39
  • 1
  • 2
  • 9

1 Answers1

0

use this code

$search = $_POST['txtboxname'];
mysqli_query("DELETE FROM tablenaem WHERE name like '%$search%'");
CodeSlayer
  • 1,318
  • 1
  • 12
  • 34