PHP dropdown with items from database -
i can't seem values of table in dropdownlist. no errors, empty dropdownlist. code:
<?php include_once ("classes/keten.class.php"); $keten = new keten(); $allket = $keten->getallketens(); echo '<select name="fk_keten_id">'; while($row = mysql_fetch_array($allket)) { echo '<option value="' . $row['pk_keten_id'] . '">' . $row['keten_naam'] . '</option>'; } echo '</select>'; ?>
function getallketens works, because use in other page.
thanks in advance :)
on request, getallket() function in classes/keten.class.php
public function getallketens() { include ("connection.php"); $ssql = "select * tblketens;"; $vresult = mysqli_query($link, $ssql); mysqli_close($link); return($vresult); }
i'm not sure mixing mysqli , mysql commands can done, in fetch_array used mysql_fetch_array instead of mysqli_fetch_array.
Comments
Post a Comment