php - PDO queries do not return all results with hyphens -


set

I have a website that reads the location from the url and runs the database query on it Is the place. For most places this is not the cause of any problem, but there are some places that fail to search. All these places have one or more hyphens in these places, but there is a large number of places that hyphen works.

Check

In the investigation of this issue, I found a lot of surprises, first of all if I execute the query from the command line or the SQLite manager then the query returns the right row But if I run a query through PDO then no results will come out, even if I ask a question like 'w%', it will fail to return the line with the correct value (although That a number of the other rows will be returned.

Code $ db = New connection $ $ string = $ string =; $ query = "Choose Name, From Page Stations Page = 'Warugul- (blue-answer)' "$ sql = $ db-> Ready ($ query); if (! $ Sql) {$ error = $ db-> errorInfo (); New Exception $ Error [2], $ error [1]);} $ sql-> execute (); $ result = $ sql-> fetchAll ();

I Which has tried

I tried some basic things like separate quotes, bound parameters Yoga. Return my value to my PHP and databases at Hex values ​​but return the same value: 77 61 72 72 61 61 67 75 6C2D 28 6E69 6C6D61 2D6E 6F 72 74 68 29. Where 2D Dash is the value. I did not have this issue with the 2D second row and before that 2D was also used. I expanded my search and found some more rows, which would not return any search on the page field with any type of search as: h: ban-bank larapun- (Edison-Point) port-kemmala-habor to me hyphen Except, no pattern could be found between them. Some examples of work: Julia-Creek mount-now-now St.-Clalda-harbor-RMIS

What do I want

Ideally I want to understand this issue and Which is the reason it is But I will settle for a solution that stops this behavior and gives the line with the result.

Note: This table and all the rows do not have any problems other than running this question which only

edit: I run the same logic with the SQLite3 library Which has the exact same behavior.

EDIT: The assumptions questions made for this were incorrect and the PDO was connected to the wrong issue, to solve this problem. See the answers below.

Sorry this question was based on false assumptions.

The passage of the connection string was an old version of the database, similar to that it was similar to most places that was not unaffected but not completely identical, causing problems for some places. Corrected connections have fixed the problem due to improving the value of the string.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -