I am trying to order my data in two ways. When I click the link the table does not update.
HTML:
echo "<tr>";
echo "<table id='customers'>
<thead>
<tr>
<th><a href='?orderBy=producto'> Producto</a></th>
<th>Unidad</th>
<th>Candidad Necesaria</th>
<th>Precio Objetivo por Unidad</th>
<th><a href='?orderBy=ctot_obj'>Valor Producto<a/></th>
<th>Remover Entrada</th>
</tr>
</thead>
PHP:
$orderBy = array('producto', 'ctot_obj');
$order = 'producto';
if (isset($_GET['orderBy']) && in_array($_GET['orderBy'], $orderBy)) {
$order = $_GET['orderBy'];
}
$query_ord = $mysqli->query("SELECT * FROM busca ORDER BY '.$order'");
What I am doing wrong?