now i got one solution of this, i need to use transaction here, for reading transaction go->
Transactions in MySQL — DatabaseJournal.com
so my query will look like-
mysql_query(conn,"begin;insert into t values(1);insert into t values(2);insert into t values('c');commit")
and where in the code u got one query fail there we can write
mysql_query(conn,"rollback");
mysql_query(conn,"commit");
now if any query failed all query updation will be rollback.............