Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Search from MySQL database table
- $search=$_POST['search'];
- $stat=$_POST['stat'];
- $split = explode(" ", $search);
- $query = $pdo->prepare("SELECT itemname, itemprice, itemupdate, itemstat, itemmarket, itemdiff FROM premium WHERE itemname LIKE ? AND itemname LIKE ? AND itemname LIKE ? AND itemname LIKE ? AND itemname LIKE ? AND itemname LIKE ? AND itemstat=? ORDER BY itemprice DESC LIMIT 15");
- $query->bindValue(1, "%$split[0]%", PDO::PARAM_STR);
- $query->bindValue(2, "%$split[1]", PDO::PARAM_STR);
- $query->bindValue(3, "%$split[2]", PDO::PARAM_STR);
- $query->bindValue(4, "%$split[3]", PDO::PARAM_STR);
- $query->bindValue(5, "%$split[4]", PDO::PARAM_STR);
- $query->bindValue(6, "%$split[5]", PDO::PARAM_STR);
- $query->bindValue(7, $stat);
- $query->execute();
- SELECT * FROM premium WHERE itemname LIKE $split[0] and itemname LIKE $split[1] and itemname Like $split[2] ... and so on ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement