class manage {

    private $entryId;

    function __construct($entryId) {
        $this->entryId = $entryId;
    }

    function deleteEntry() {
        //delete $this->entryId from database
    }

}

$m = new manage(23);
$m->deleteEntry();

how this method delete entry from db deleteEntry();

how sql query works with this

please help to understand

If you have object for database then that function can be used.
otherwise,

<?
	 function deleteEntry() {
        return mysql_query("delete from manage where entryId='".$this->entryId."'") or die(mysql_error());//delete $this->entryId from database
    }
?>

Thanks

I think This code needs intval() before assigning number.

function __construct($entryId) {

$this->entryId = intval($entryId);

}
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.