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>';
    }
}

Recommended Answers

All 2 Replies

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 :)

Thanks cereal.. Ace

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.