Hi
I am in the process of learning PHP, and I eventually want to build a mini forum for a small site that needs it.
I basically want to delete posts from a database by referring to their id. I so far use:
<a href=admin.php?do=delete:$id>Delete?</a>
As the link to delete it. And the delete function is:
function delete($id) {
$query = doquery("DELETE FROM {{table}} WHERE id='$id'", "TABLE_NAME");
header("Location: admin.php");
die();
I basically need help, Ive never tried deleting anything before, and im having problems. Can anyone help me please?
I currently get errors similar to this:
Warning: Missing argument 1 for delete() in /home/public_html/admin.php on line 621
Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/admin.php:621) in /home/public_html/admin.php on line 627
Thankyou for any guidance you can give, i am new to php.