DaDaBIK
This forum is devoted to the discussion about the software DaDaBIK database front-end
the PHP Database application generator for MySQL, PostgreSQL and SQLite; also available for Wordpress.

Welcome! Log In Create A New Profile

Advanced

AND / OR operators during a search

Posted by ryarkiv 
AND / OR operators during a search
December 12, 2018 01:20PM
// enable the possibility, for users, to specify AND / OR operators during a search e.g. typing "apple OR banana" (0|1)
// operators are case sensitive, OR and AND must be written in capital letters
// users cannot mix operators (city AND Europe OR USA)
$enable_user_booleans = 1;

I can´t make this happen. Why?
Re: AND / OR operators during a search
December 13, 2018 02:00AM
Please describe better the issue: DaDaBIK version, the string you typed, the expected result, the actual result, ....

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Re: AND / OR operators during a search
December 13, 2018 05:10AM
Well for instance I have a database with a lot of names, including 1069 "Jens" and 303 "Hans".
When I search contains "Jens OR Hans", nothing returns.

The database also has 6 "Peter Andersen".
When I search contains "Peter AND Andersen", nothing returns.
Re: AND / OR operators during a search
December 13, 2018 09:24AM
Please set $display_sql = 1 in config.php and paste here the query produced by your search.

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Re: AND / OR operators during a search
December 14, 2018 12:50AM
I did this:

// display the main sql statements of insert/search/edit/detail operations for debugging (0|1)
// note that the insert sql statement is will be displayed only if $insert_again_after_insert is set to 1 and $show_details_after_insert = 0
$display_sql = 1;

Search LIKE/Contains "Jens AND Hans"

No results and no query on the screen.

Search Contains "Jens Hans" produced 4 posts, but no query.

I also followed the instructions of the second line marked //

No results and no query on the screen


I think I know what you want me to produce, because I made the same operation with Dadabik 4.x and here I was able to produce the query on the screen. (The two Dadabik versions are not on the same server).
Re: AND / OR operators during a search
December 14, 2018 01:31AM
Sorry, I made a blunder. Forget what I wrote above.

Here it comes:

Your SQL query (for debugging purpose): SELECT `Ry-kommune-1901`.`KIPnr`, `Ry-kommune-1901`.`Løbenr`, `Ry-kommune-1901`.`Stednavn`, `Ry-kommune-1901`.`Ejendom_navn`, `Ry-kommune-1901`.`Matr_nr`, `Ry-kommune-1901`.`Ejer`, `Ry-kommune-1901`.`Husstand_familienr`, `Ry-kommune-1901`.`Kildenavn`, `Ry-kommune-1901`.`Køn`, `Ry-kommune-1901`.`Civilstand`, `Ry-kommune-1901`.`Tro`, `Ry-kommune-1901`.`Fødselsdato`, `Ry-kommune-1901`.`Fødested`, `Ry-kommune-1901`.`Tilflyttet`, `Ry-kommune-1901`.`Fra`, `Ry-kommune-1901`.`Stilling_husstand`, `Ry-kommune-1901`.`Erhverv`, `Ry-kommune-1901`.`Arbejder_for`, `Ry-kommune-1901`.`Handikap`, `Ry-kommune-1901`.`Ægteskab`, `Ry-kommune-1901`.`Ægtefælle_død`, `Ry-kommune-1901`.`Levende_børn`, `Ry-kommune-1901`.`Døde_børn`, `Ry-kommune-1901`.`Anmærkning`, `Ry-kommune-1901`.`Kildebemærkning`, `Ry-kommune-1901`.`Kommentar`, `Ry-kommune-1901`.`Egne_bemærkinger` FROM `Ry-kommune-1901` WHERE `Ry-kommune-1901`.`Kildenavn` LIKE '%Jens OR Hans%'


But still no results.
Re: AND / OR operators during a search
December 24, 2018 09:32AM
Hello,
from your SQL query, it seems DaDaBIK thinks $enable_user_booleans is disabled.
Can you post a screenshot or a paste part of your config.php (the part containing $enable_user_booleans )?

Best,

________________________________________________________
Eugenio |\.-./| DaDaBIK developer and project admin
Sorry, only registered users may post in this forum.

Click here to login