Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $sortBy = $_GET['sortBy'];
- $color = $_GET['color'];
- echo $sortBy;
- echo $color;
- $i = 0;
- if ($color != '')
- {
- if ($sortBy != '')
- {
- $items = $con -> prepare("SELECT * FROM item_descr WHERE color_base1 = :colorbase1 SORT BY $sortBy");
- $items = bindParam(':colorbase1', $color, PDO::PARAM_STR);
- }
- else
- {
- $items = $con -> prepare("SELECT * FROM item_descr WHERE color_base1 = :colorbase1");
- $items = bindValue(':colorbase1', $color);
- }
- }
- else
- {
- if ($sortBy != '')
- {
- $items = $con -> prepare("SELECT * FROM item_descr ORDER BY $sortBy ASC");
- }
- else
- {
- $items = $con -> prepare("SELECT * FROM item_descr ORDER BY date DESC");
- }
- }
- $row_count = 0;
- $items ->execute();
- while($info = $items->fetch(PDO::FETCH_ASSOC))
- {
- echo "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement