Hey guys, need some help with this table, the table works fine but when i try to use the ORDER BY function to have it in alphabetical order i get the following error. Any help in getting this table in alphabetical order would be very helpful!
Notice : Trying to get property ‘num_rows’ of non-object.
<?php
$conn = mysqli_connect(‘localhost’,‘root’,’’, ‘working’);
if ($conn-> connect_error) {
die(“Connection failed:” .$conn-> connect_error);
}$sql = “SELECT Microphone_Audio_Kits, Microphone_Equip_Condition, Camera_Kits, Camera_Equip_Condition, Lighting_Kits, Lighting_Equp_Condition, Monitors_TriPods_Extras, Monitors_TriPods_Extras_Condition FROM equipment ORDER BY ASC”;
$result = $conn-> query($sql);
$sql = “SELECT Microphone_Audio_Kits, Microphone_Equip_Condition, Camera_Kits, Camera_Equip_Condition, Lighting_Kits, Lighting_Equp_Condition, Monitors_TriPods_Extras, Monitors_TriPods_Extras_Condition FROM equipment ORDER BY “;
$result = $conn-> query($sql);
if ($result-> num_rows > 0) {
while ($row = $result-> fetch_assoc()) {
echo “"; ”.$row[‘Microphone_Audio_Kits’].” ”.$row[‘Microphone_Equip_Condition’]." ".$row[‘Camera_Kits’]." ".$row[‘Camera_Equip_Condition’]." ".$row[‘Lighting_Kits’]." ".$row[‘Lighting_Equp_Condition’]." ".$row[‘Monitors_TriPods_Extras’]." ".$row[‘Monitors_TriPods_Extras_Condition’]."
}
echo “”;
}
else {
echo “0 result”;
}
?>