Hi
I am trying to order the following query by price when the varaible $concern=="pric e"; But it is not working. Here is my code.
Can you spot something?
Thanks
I am trying to order the following query by price when the varaible $concern=="pric e"; But it is not working. Here is my code.
Code:
for($key=0 ;$key<count($first);$key++)
{
if(($first[$key])>0.1){
$blank++;
$set=$key+1;
if($concern=="price"){
$sql2 = "SELECT * FROM laptop2 WHERE CODE=$set ORDER BY PRICE";
$query2 = $DB->Query($sql2);
}
echo'<p> <hr noshade="noshade" /></p>';
}
if($array = $DB->FetchArray($query2)){
echo "<table bgcolor=LightGrey border=1>\n";
echo"<tr><td>ID</td><td>Brand</td><td>Model</td><td>Processor (GHz)</td>
<td>Hard Drive (GB)</td><td> Graphic card (MB)</td>
<td>Battery life(Hours)</td><td>Multimedia</td><td>Price (£)</td></tr>\n";
// do {
printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</d><td>%s</d><td>%s</d><td>%s</d> </tr>",$array['CODE'],$array['BRAND'],$array['MODEL'],$array['PROCESSOR (Ghz)'],
$array["STORAGE (GB)"],$array["GRAPHIC CARD (MB)"],$array["BATTERY"],$array["MULTIMEDIA"],$array["PRICE"]);
// print_r($array);
}while($array=$DB->FetchArray($query2));
echo"</table>\n";
Thanks
Comment