delete-all.php
343 Bytes
<?php
//include database connection data
include_once "dbconnection.php";
//make a query
$query = "TRUNCATE TABLE toDoList;";
//perform the query on the database
$result = $link -> query($query);
//check if there is any task deleted
if($result->num_rows <= 0) {
echo "No task was deleted";
}
//close the connection
$link -> close();
?>