My table structure !
tblmodel
-fldmodelid
-fldmodelname


tblcardetail
-fldcardetailid
-fldmodelid
-flddefaultphoto

When I delete fldmodelid,i want to delete automatic tblcardetail.flddefaultphoto.Now i can delete in database.but.. the folder(../upload) that have photos.. i cann't delete that photos.. how to write unlink function!at another page ?

Try this

$rs_file = mysql_query("select flddefaultphoto from tblcardetail where fldmodelid=".$_REQUEST["delid"]);

		while($file=@mysql_fetch_array($rs_file))
                {
		@unlink("../upload/".$file["flddefaultphoto"]);
                }
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.