is_write_type($sql) 
Parameters:
$sql (string) – The SQL statement  Returns:
TRUE if the SQL statement is of “write type”, FALSE if not  Return type:
bool  
Determines if a query is of a “write” type (such as INSERT, UPDATE, DELETE) or “read” type (i.e. SELECT).