com'era all'inizio funzionava anche senza apici, l'unico difetto è che era un metodo di scrittura del codice deprecato.
Mi pare di aver capito che il controllo che fai va a vedere semplicemente se il record è stato inserito quindi mysql_num_rows non va bene come puoi vedere qui
http://php.net/manual/en/function.mysql-num-rows.php
Retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result set. To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query, use mysql_affected_rows().
quindi intanto cambia la funzione con mysql_affected_rows