I have this query, but the ordering by is not working. It should order by value, but doesn't react. you'll see what I mean in the code.
<table class="pme-main">
<tr>
<th class="pme-header">Bestemming</th>
<th class="pme-header">Naam Klant</th>
<th class="pme-header">Aantal Manden</th>
<th class="pme-header">Aantal Duiven</th>
<th class="pme-header">Naam Bestemmeling</th>
</tr>
<?php
$con =
mysql_connect("****","****","****");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("****", $con);
$query = "SELECT z.Bestemming, b.Name, k.Naam, k.ID, m.Aantal_Duiven,
s.Aantal_Manden FROM Shipments AS s JOIN Zendingen AS z ON s.Zending_ID
= z.ID JOIN Klanten AS k ON s.Klant_ID = k.ID JOIN Manden AS m ON
s.Mand_ID = m.ID JOIN Bestemmeling AS b ON s.Bestemmeling_ID = b.ID
WHERE z.Actief = 1 order by k.Naam, s.Aantal_Manden, m.Aantal_Duiven
ASC";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
echo "<tr>";
echo " <td class=\"pme-cell-0\">{$row['Bestemming']}</td>\n";
echo " <td class=\"pme-cell-1\">{$row['Naam']}</td>\n";
echo " <td class=\"pme-cell-0\">{$row['Aantal_Manden']}</td>\n";
echo " <td class=\"pme-cell-1\">{$row['Aantal_Duiven']}</td>\n";
echo " <td class=\"pme-cell-0\">{$row['Name']}</td>\n";
echo "</tr>\n";
}
?>
</table>
and this is what it gives me:
Bestemming Naam Klant Aantal Manden Aantal Duiven Naam Bestemmeling
Peking ---- Andre Guebs (via Mr. Lin) 2 10 Chong Ping
Peking ---- Andre Guebs (via Mr. Lin) 2 12 Nasi Goreng
Peking ---- Andre Guebs (via Mr. Lin) 2 14 Ping Pong
Peking ---- Andre Guebs (via Mr. Lin) 2 3 Nasi Goreng
Peking ---- Andre Guebs (via Mr. Lin) 5 14 Chong Ping
Peking ---- Andre Guebs (via Mr. Lin) 8 8 Chong Ping
As you can see, the underlined values are the ones he orders, but as far as I know, 3 comes before 10,12 and 14...
What am I missing?