All pastes #467665 Raw Edit

BMCouto

public php v1 · immutable
·published 2007-05-02 17:22 UTC
rendered paste body
//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