Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update Report_Sales.php
productname added
  • Loading branch information
jic13003 committed Dec 6, 2016
1 parent 00a0b4f commit bc56221
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions adminPages/Report_Sales.php
Expand Up @@ -15,9 +15,11 @@ require("../commonFunctions.php");
<div id='contentwrapper'>
<?php
if (isset($_GET['Category'])){ //Check if category has already been set
$query = "SELECT * FROM `sales by category` WHERE CategoryID = ?"; //'?' in place of variable
$query = "SELECT * FROM `sales by category` WHERE CategoryID = ?
AND ProductName = ? "; //'?' in place of variable
$ProductName = % . $_GET['ProductName'] . %;
$stmt = $con->prepare($query);
$stmt ->bind_param("d", $_GET['Category']); //Bind category to query, category is taken in as CategoryID, so it's a digit
$stmt ->bind_param("ds", $_GET['Category'], $ProductName); //Bind category to query, category is taken in as CategoryID, so it's a digit
$stmt ->execute();

$searchResult = $stmt->get_result(); //Get results
Expand Down

0 comments on commit bc56221

Please sign in to comment.