i just want to put a search engine that can search both item id or item name.
but my problem is.
before when i try to search item using item id. nothings happen. but when i try to search using item name the search works fine.
but after i add this. the problem has been change.
when i try to search using item id it works now. but when i try to search using item name. nothings happen now.
<?phpif (!defined('FLUX_ROOT')) exit;$item_name = trim($params->get('item_name'));if($item_name == ''){ $this->redirect('?module=search_error&error_id=1');}elseif(strlen($item_name) < 4){ $this->redirect('?module=search_error&error_id=2'); }else{ $sql = "SELECT * FROM item_db_re WHERE name_japanese LIKE ?";+ $sql = "SELECT * FROM item_db_re WHERE name_english LIKE ?";+ $sql = "SELECT * FROM item_db_re WHERE id LIKE ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array("%$item_name%")); $item_res = $sth->fetchAll(); if(!$item_res) { $sql = "SELECT * FROM item_db2 WHERE name_japanese LIKE ?";+ $sql = "SELECT * FROM item_db2 WHERE name_english LIKE ?";+ $sql = "SELECT * FROM item_db2 WHERE id LIKE ?"; $sth = $server->connection->getStatement($sql); $sth->execute(array("%$item_name%")); $item_res = $sth->fetchAll(); if($item_res) { $this->redirect('?module=search_error&error_id=3'); } } }?>
i just want to put a search engine that can search both item id or item name.
but my problem is.
Share this post
Link to post
Share on other sites