Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with searching in Phalcon_Model_Query #15

Closed
Hockeychap opened this issue Jun 25, 2012 · 3 comments
Closed

Error with searching in Phalcon_Model_Query #15

Hockeychap opened this issue Jun 25, 2012 · 3 comments

Comments

@Hockeychap
Copy link

Hi,

Have been testing the functionality of the Phalcon and the devtools package. Have run the scaffold command against a very simple mysql order table (orderid int, customerid int, orderdate date).

Using the search screen the search works fine for the integer fields, but not the date field. It looks like Phalcon_Model_Query is not putting quotes around the like statement (error sql attached below).

SELECT orderid, customerid, orderdate FROM justin_testing.orders WHERE customerid = 1 AND orderdate LIKE %2012-06% ORDER BY orderid

The order table appears tohave been created correctly in the model with the orderdate field modeled as a string.

Cheers
Justin

@Hockeychap
Copy link
Author

Update: I've fixed this on my local copy by added a pair of single quotes into line 361 model/query.c so that it now reads :

PHALCON_CONCAT_SVS(r15, "'%", value, "%'");

rather than

PHALCON_CONCAT_SVS(r15, "%", value, "%");

Cheers
Justin

@phalcon
Copy link
Collaborator

phalcon commented Jun 25, 2012

Thanks Justin!, we'll add this to 0.4.2 :)

@phalcon
Copy link
Collaborator

phalcon commented Jun 26, 2012

Hi Justin, 0.4.2 is now available, thanks for reporting this!

@phalcon phalcon closed this as completed Jun 26, 2012
ovr pushed a commit to ovr/cphalcon that referenced this issue Dec 25, 2013
Added `zephir help` command to zephir.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants