October 2009
Beginner
408 pages
7h 27m
English
You need to write your deleteEntry() function in functions.inc.php. This function needs to accept the entry URL as an argument, then place that URL into a DELETE query that removes a maximum of one entry from the entries table.
Your MySQL query should read like this:
DELETE FROM entries WHERE url=? LIMIT 1
After you prepare the statement for execution, you use your supplied URL to execute the argument. You can make sure that the function executes successfully by returning the value of $stmt->execute() as the return value of your function.
Add your deleteEntry() function below retrieveEntries() in functions.inc.php:
function deleteEntry($db, $url)
{
$sql = "DELETE FROM entries
WHERE url=?
LIMIT ...Read now
Unlock full access