Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

  • liubov
  • liubov's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
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

Please Log in or Create an account to join the conversation.

Last edit: by liubov.

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

  • liubov
  • liubov's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
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

Please Log in or Create an account to join the conversation.

Last edit: by liubov.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Fixed.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

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

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

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

Danke !
Marc.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.082 seconds

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started