Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Search Box -> msql_errors with quote in words

[FIXED] Search Box -> msql_errors with quote in words 31 May 2012 13:01 #2453

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 35
  • Karma: 22
when you enter a word with quote in the search box, query return mysql error, ie : liubov's
   //search_search : search on Nom du Chien
   $search_search = $this->getState('search.search');
   $this->_addSearch('search', ' a.dname', 'like');
   if (($search_search != '') && ($search_search_val = $this->_buildSearch('search', $search_search)))
   $where[] = $search_search_val;

return:
WHERE (a.dname LIKE '%liubov's%') ORDER BY a.dname
( ! ) Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in D:\wamp\www\Jbreeding2.5.0\libraries\joomla\database\database\mysqli.php on line 263

I saw the function _buildSearch in jmodel.list, but the $db->Quote("%%s%") does not seem to work with me.
I will check in the SandBox ...

Thx,

Marc
Last Edit: 31 May 2012 13:14 by liubov.
The administrator has disabled public write access.

Re: Search Box -> msql_errors with quote in words 01 Jun 2012 04:40 #2460

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 35
  • Karma: 22
So I ran my component in the SandBox.

=> no msql error displayed, but result is null (no items) when I enter a word with a quote.
using word [liubov's] ...
In my Dogs managment Component, that might display all my breeding production.
If you can have a look ...

Thx
Last Edit: 01 Jun 2012 04:41 by liubov.
The administrator has disabled public write access.

Re: Search Box -> msql_errors with quote in words 26 Jun 2012 11:16 #2673

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
Fixed.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Search Box -> msql_errors with quote in words 26 Jun 2012 12:20 #2680

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 35
  • Karma: 22
Hi Joce!

I will paste the new code, (buildSearch function, I think) ...

Danke !
Marc.
The administrator has disabled public write access.
Time to create page: 0.074 seconds

Get Started