error in CGridView when search with . ( dot ) or , ( comma ) error in CGridView when search with . ( dot ) or , ( comma )
Posted 07 April 2012 - 06:07 AM
I used CGridView and when i filter with dot or comma character it shows error as,
Error 500: <h1>CDbException</h1>
<p>CDbCommand failed to execute the SQL statement: SQLSTATE: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1. The SQL statement executed was:
is there any validation or something else as it not throws the error.
Posted 07 April 2012 - 06:27 AM
i.e : when i filter with . ( dot ) it creates query as below and throw error,
SELECT COUNT(*) FROM `xtzTable` `e` join abcTable d on e.xx=d.yy WHERE ID <> 1 AND E_ID = .
( see last character is . (dot) and that might problem )
Posted 07 April 2012 - 07:04 AM
i use 'dataProvider'=>$model->search() as dataProvider, but the function search in model is not generate by crude, i just created for my own way for customized filter and sorting . i think the problem was somewhere there so i create function as searchModel() what i use same as crude generates and use that as dataProvider ("'dataProvider'=>$model->searchModel()") and it works. now i can filter on special characters.