Possible Duplicate:
Best way to prevent SQL Injection in PHP
I wanted to ask you do i need to use something else from the code bellow:
         if(isset($_POST['submit'])) {
         $username = $_POST['username'];
         $password = $_POST['password'];
         $validate = '/^[a-z]+[a-z0-9]*[.-_]*$/i';
               if ((preg_match($validate , $username)==true) && (preg_match($validate ,                                                                                     $password)==true)) {
                        some query...   
               } else {
                        echo "You've used some characters that aren't allowed.";
               }
       }else {
               echo 'Not logged!';  
       }
Is this regular expression good to save me from SQL injection?Or can you give me any other suggestions to make my login form good enought!
 
     
    