0

Hi guys

Can someone please point me in the right direct. cant seem to get round the error on the $r = mysql_query() line.

<?php
require_once ('../mysql.php');

if(isset($_GET['delete'])) {
    $id = (int)$_GET['delete'];
    $r = mysql_query ($dbc,"DELETE FROM customer WHERE id = {$id}");
    if(mysql_affected_rows($dbc) ==1){
        $message = '<p>Record deleted succefully</p>';
    }
}

Edited by Dani: Formatting fixed

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by Jeffwizzy
0

Place resource link as second parameter, the first has to be the query string:

$r = mysql_query("DELETE FROM customer WHERE id = '$id'",$dbc);

Bye :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.