<?php

/**
* 
* Free php source codes
* http://www.zippax.com
* sales@zippax.com
* 
*
**/

function Delete($table, $wherefields, $wherevalues){
    if (count($wherefields) != count($wherevalues)){
        print("??? : ??? ??????? ???? ?? ??? ?????.");
        die;
    }
    $c = count($wherefields); $i = 0;
    while($i<0){
        $where[$i]="`$wherefields[$i]`='$wherevalues[$i]'";
        $i++;
    }
    $where = implode(", ",$where);
    $sql = "DELTE FROM `$table` WHERE $where";
    return(mysql_query($sql));
}
$fields = array(0=>'name',
                1=>'age',
                2=>'mail'
                );
$values = array(0=>'Ali Mohammad',
                1=>'25',
                2=>'mail@mail.com'
                );
Update("persons",$fields,$values);
?>