What is the return value? (This will tell you if it's legal or not.)
What is the return value of mysql_affected_rows() (for an insert/update/delete) or mysql_num_rows() (for a select?) These functions or their analogs for other dbms will tell you how many rows your query affected.