echo中的函数为什么会出错?

I read some topics here and in other forums and find a way to set a function in a echo. But it doesnt show my stuff. My Code

echo "<tr>
        <td>
           Choose people:<br>
            ",choose_kunde(),"
        </td>
    </tr>";

my function:

   function choose_kunde()
{
    require './config/config.inc.php';
    if($result2 = mysqli_query($db, "SELECT kunden_id, vname, nname FROM kunden"))
    {
        echo "<select name='kunde_a'>";
        while($adr = mysqli_fetch_assoc($result2))
        {
            echo "<option value='".$adr['vname']."|".$adr['nname']."|".$adr['kunden_id']."'>".$adr['vname']." ".$adr['nname']."</option>";
        }
        echo "</select>";
    }
    else
    {
        echo "Daten konnten nicht aus der Datenbank gelesen werden.<br>";
        echo mysqli_error($db);
    }
}
查看全部
donglang9880
donglang9880
2016/06/14 09:03
  • function
  • php
  • echo
  • sql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复