hip1/po/bandlist.php

<?php include('../db.php'); $bandtext = $_GET['bandtext']; $memberid = $_GET['memberid']; $wheread = "band_id in (select band_id from band_members where member_id = $memberid)"; if ($bandtext) { $where = "where name like '%$bandtext%'"; if ($memberid){ $where = "$where and $wheread"; } } elseif ($memberid){ $where = "where $wheread"; } //echo $where; $query = "select * from bands $where order by name"; $result = mysqli_query($db, $query) or die(mysqli_error($db)); while ($row = mysqli_fetch_array($result)){ echo "<div onclick='bandselected($row[band_id])'>$row[name]</div>"; } ?>

Resultaat

Made by Thijs Aarnoudse