PHP combobox not showing in HTML table -


i've created in php html table combobox retrieves values of mysql database table.

this code:

<?php     include_once 'indeling/header.php';  print '<a href="overzicht_notass.php" class="button">overzicht nota\'s</a> <br /><br />';  $sql = " select     notas.id notaid     , notas.klantid klantid     , notas.bedrag bedrag     , notas.datum datum     , contacten.bedrijf bedrijf     , contacten.adres adres     , contacten.woonplaats woonplaats     notas     left join contacten          on (notas.klantid = contacten.id); ";  function bedrijven($mysqli) {  $sqlbedrijven = " select      id ,   bedrijf ,   adres ,   woonplaats     contacten     order bedrijf asc ";      $resultbedrijven = $mysqli->query($sqlbedrijven);      if (!$resultbedrijven) {         echo "something went wrong: (" . $mysqli->error .")";     }         echo "<select name = klantid>\n";         while ($row = $resultbedrijven->fetch_assoc()) { echo <<<opt <option value="{$row['id']}"> {$row['bedrijf']} - {$row['adres']} - {$row['woonplaats']} </option>  opt;         }         echo "</select>\n"; }   $result = $mysqli->query($sql);      if (!$result) {         echo "oeps hier gaat iets fout: (" . $mysqli->error .")";     }     else {         printf("er zijn momenteel %d nota's.<br />", $result->num_rows);  echo " <table>     <tr>         <th>notanummer.</th>         <th>bedrijf</th>         <th>bedrag</th>         <th>datum</th>         <th>bewerken</th>     </tr> ";      while ($row = $result->fetch_assoc()) {         echo '<tr> <form action="overzicht_relaties_bewerken.php" method="post">         <td> <input type="text" class="short" name="notaid" value="' . $row['notaid'] . '"></td>         <td> ' . bedrijven($mysqli) . ' </td>          <td> <input type="text" name="bedrag" value="' . $row['bedrag'] . '"></td>         <td> <input type="date" name="datum" value="' . $row['datum'] . '"></td>         <td> <input type="submit" name="update" value="aanpassen" class="button">' . '<br />         <input type="submit" name="delete" value="verwijderen" class="button"' . '"></td>         </tr></form>         ';     }         echo "</table>"; }  ?> 

it works see comboboxes above table , not in second td bedrijven($mysqli)

here dump of mij html source code of webpage:

<a href="overzicht_notass.php" class="button">overzicht nota's</a> <br /><br />er zijn momenteel 2 nota's.<br /> <table>     <tr>         <th>notanummer.</th>         <th>bedrijf</th>         <th>bedrag</th>         <th>datum</th>         <th>bewerken</th>     </tr> <select name = klantid> <option value="37"> afsdf - fasdf12 - klarenbeek - (gelderland) </option> <option value="36"> afsdf - fasdf12 - klarenbeek - (gelderland) </option> <option value="38"> afsdf2 - fdas - klarenbeek </option> 

now have bunch of more option values , then:

</select> <tr> <form action="overzicht_relaties_bewerken.php" method="post">         <td> <input type="text" class="short" name="notaid" value="2"></td>         <td>  </td>          <td> <input type="text" name="bedrag" value="125.50"></td>         <td> <input type="date" name="datum" value="2013-06-04"></td> 

the table data under tabledata id blanc...??

so call function @ right place (2nd td) shows comboboxes somewhere else.

anny idea how possible?

i not @ php think select tag not in table! see how in html:

<table> <tr>     <th>notanummer.</th>     <th>bedrijf</th>     <th>bedrag</th>     <th>datum</th>     <th>bewerken</th> </tr> <tr>     <td colspan='5'>         <select name = klantid>         <option value="37"> afsdf - fasdf12 - klarenbeek - (gelderland) </option>         <option value="36"> afsdf - fasdf12 - klarenbeek - (gelderland) </option>         <option value="38"> afsdf2 - fdas - klarenbeek </option>         </select>     </td> </tr>  <tr> <form action="overzicht_relaties_bewerken.php" method="post">     <td> <input type="text" class="short" name="notaid" value="2"></td>     <td>  </td>      <td> <input type="text" name="bedrag" value="125.50"></td>     <td> <input type="date" name="datum" value="2013-06-04"></td> 

so change php code from:

    echo "<select name = klantid>\n";     while ($row = $resultbedrijven->fetch_assoc()) {     echo <<<opt     <option value="{$row['id']}"> {$row['bedrijf']} - {$row['adres']} -       {$row['woonplaats']} </option>      opt;     }     echo "</select>\n"; 

to:

    echo "<tr><td colspan='5'><select name = klantid>\n";     while ($row = $resultbedrijven->fetch_assoc()) {     echo <<<opt     <option value="{$row['id']}"> {$row['bedrijf']} - {$row['adres']} -       {$row['woonplaats']} </option>      opt;     }     echo "</select></td></tr>\n"; 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -