Hi,
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[42000]: 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.
Page 1 of 1
error in CGridView when search with . ( dot ) or , ( comma ) error in CGridView when search with . ( dot ) or , ( comma )
#2
Posted 07 April 2012 - 06:27 AM
the error occured only when i filter on type integer value as ( id , no. of days ... )
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 )
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 )
Thanks,
Kiran Sharma.
Kiran Sharma.
#3
Posted 07 April 2012 - 07:04 AM
Ya, now its solved.
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.
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.
Thanks,
Kiran Sharma.
Kiran Sharma.
Share this topic:
Page 1 of 1