After adding this line 'order by Fines($)', it always said: Problem Query. when I delete die(problem query)function, it said cannot find the parameters.
<?php
if(isset($_POST["searchBtn"]))
{
$strInputSuburb = "";
$strInputStreet = "";
$strInputSuburb = $_POST["suburb"];
$strInputStreet = $_POST["street"];
if(!empty($strInputSuburb) || !empty($strInputStreet))
{
$conn = @mysqli_connect("localhost", "example", "exmaple")
or die ("Failed to connect server");
@mysqli_select_db($conn, "example")
or die ("Database not available");
$querySql1 = "select * from Infringement
where suburb like '%$strInputSuburb%' and street1 like '%$strInputStreet%'
order by Fines($) acs";***// After adding this line, it always said: Problem Query***
$result1 = mysqli_query($conn, $querySql1)
or die ("Problem Query...");.***// when I delete die function, it said cannot find the parameters.***
$count = mysqli_num_rows($result1);
if(!count==0){
echo "<div class='table-responsive row' id='tableTop'>";
echo "<div class='col-md-10 col-md-offset-1'>";
echo "<table class='table table-bordered table-hover '>";
echo "<tr><th>Location</th><th>Suburb</th><th>No. of Infringements</th><th>Fines($)</th></tr>";
while($Row = mysqli_fetch_row($result1)){
echo "<tr><td>Intersection of ".$Row[1]." and ".$Row[2]."</td><td>".$Row[3]."</td><td>".$Row[4]."</td><td>".$Row[5]."</td></tr>";
}
echo "</table>";
echo "</div>";
echo "</div>";
}
else {
echo "No data found! Please search again!";
}
mysqli_free_result($result1);
mysqli_close($conn);
}
else {
echo "<div style='padding-top:9px;color:grey' class='col-md-3 col-md-offset-2'>";
echo "Please type any <b>Suburb</b> or <b>Street</b>.";
echo "</div>";
}
}
?>