//this is the function on file.phpfunction nomes_comerciais() { $query = "SELECT * FROM comerciais ORDER BY nome asc"; $resultado = mysql_query($query) or die( mysql_error() ); while($linha = mysql_fetch_array($resultado)){ print( "<option value='".$linha['nome']."'>".$linha['nome']."</option>"); } }//then on index.php i make a require of file.php (wich is the file with the insert query too and the select is like this:Comercial Angariador: <select name="comercial-ang"><option> ----- </option><?nomes_comerciais();?></select><br />//on the query i'm putting $_POST['comercial-ang'] but it's not inserting on the db