php - Selecting array of unique results from database and using them foreach -


i'm trying array of unique rows database , use them in foreach dropdown menu, have never ever touched arrays or foreach function. thought getting it, code doesn't seem work. couldn't find on site or web on subject turn help. in advance.

<select name='item'> <?php $getitems = $data->query('select * items id != "'.$sellid.'"');  while($row = $getitems->fetch_assoc()) {     $getitems_2 = $data->query('select * inventory itemid = "'.$row['id'].'"');     $raw = $getitems_2->fetch_assoc();     $raw = array_unique($raw['itemid']));     foreach ($raw $value) {         echo "<option value='".$value."'>".$row['name']."</option>";     } }  ?> 


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -