currently i have table doc1, doc2, doc3, doc4, doc5...i need to update by using array
here example mysql
UPDATE material set doc1 = $doc1 where id = $id
$result = mysql_query("UPDATE material SET doc1='$doc1' WHERE mat_id='$mat_id'")
or die(mysql_error());
how can i put array for doc?..i really confius how to do it n to make sure this table would not capture the same value each other n update the doc if not same i mean
1) if doc1=doc1 it won't update else doc1!=doc1 it will update the new value
2) if doc1==null or doc1=="" it update
3) this will keep loop to make sure it update a new id n not duplicate the id on each table
plz help..
**sorry for my bad eng



