hip1/po/memberlist.php

<?php include('../db.php'); $membername = $_GET['membername']; $bandid = $_GET['bandid']; $wheread = "member_id in (select member_id from band_members where band_id = $bandid)"; if ($membername) { $where = "where (first_name like '%$membername%' or last_name like '%$membername%' or artist_name like '%$membername%')"; if ($bandid){ $where = "$where and $wheread"; } } elseif ($bandid){ $where = "where $wheread"; } $query = "select * from members $where order by first_name, last_name"; //echo "$where"; $result = mysqli_query($db, $query) or die(mysqli_error($db)); while ($row = mysqli_fetch_array($result)){ if ($row['first_name'] || $row['last_name']){ $namedisplay = "$row[first_name] $row[last_name]"; } else{ $namedisplay = "$row[artist_name]"; } echo "<div onclick='memberselected($row[member_id])'>$namedisplay</div>"; } ?>

Resultaat

Made by Thijs Aarnoudse