exclude status in dropdown list

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


exclude status in dropdown list



good day



im trying to exclude all "Defective" in my column status in my "mobo" table and so far this code is not working. it's still showing everyting in my dropdown list:


<?php
$conn = new mysqli('localhost', 'root', 'admin2018', 'inventory')
or die ('Cannot connect to db');
$result = $conn->query("select mobo, status FROM mobo WHERE NOT 'status = Defective'");
echo "<select name='mobo'>";

while ($row = $result->fetch_assoc()) {

unset($id, $name);
$id = $row['mobo'];
$name = $row['mobo'];
echo '<option value="'.$id.'">'.$name.'</option>';

}
echo "</select>";
?>




1 Answer
1



nevermind I already fix it using


<?php
$conn = new mysqli('localhost', 'root', 'admin2018', 'inventory')
or die ('Cannot connect to db');
$result = $conn->query("select mobo, status FROM mobo WHERE status!='Defective'");
echo "<select name='mobo'>";

while ($row = $result->fetch_assoc()) {

unset($id, $name);
$id = $row['mobo'];
$name = $row['mobo'];
echo '<option value="'.$id.'">'.$name.'</option>';

}
echo "</select>";
?>






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Better method to check all objects' parameters with a single call

List of members of the United States House of Representatives in the 114th Congress by seniority