i recommend using
PHP Code:
mysql_fetch_assoc(
instead of
PHP Code:
mysql_fetch_array(
and concerning the sql injections, all the $_GET and $_POST variables in the query do it this way
PHP Code:
INSERT INTO .....
VALUES (
'".addslashes($_GET['somevariable'])."',
'".addslashes($_POST['anothervar'])."'
);
that will replace a ' or " with \"