Answers for "function criarCombo($table,$id,$valor)"

0

function criarCombo($table,$id,$valor)

<?php
function criarCombo($table,$id,$valor)
{
   $sql = "SELECT * FROM ".$table."";
   $rs_sql = mysql_query($sql);
   while($linha=mysql_fetch_array($rs_sql))
   {
     $chave = $linha[$id];
     $nome  = $linha[$valor];
     $combo = $combo . "<option value=\"$id\">$nome</option>";
   }
   echo $combo;
}
?>
Posted by: Guest on January-13-2021

Browse Popular Code Answers by Language