| Index
» Projekty
» phpMyEdit
» Fórum
» avoid sql LIKE in "Search" mode |
 |
uioreanu
Založený: 09.05.2006
Príspevky: 1
Zaslal: 2006-05-09 15:26
Návrat hore
Odpovedať s citátom
|
I have a status field called istatus which can have values from 0 to 100. My problem is that when I try to search for the 0 value, it matches 10 as well, because the query goes like: field like '%0%'; and 10 matches to that query. How can I easily setup the fdd fields so that the LIKE query is replaced with an exact SQL search?
I'm sorry if this was answered before but I couldn't find it.
|
mattpaul
Založený: 07.06.2006
Príspevky: 1
Zaslal: 2006-06-07 18:13
Návrat hore
Odpovedať s citátom
|
for something like this, the field type should not be a varchar string but an int. then your SELECT statement's WHERE clause becomes:
... WHERE istatus=0
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2006-06-08 09:43
Návrat hore
Odpovedať s citátom
|
http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.basic-options.html#AEN830
|
siread1
Založený: 14.11.2009
Príspevky: 2
Zaslal: 2009-11-14 16:25
Návrat hore
Odpovedať s citátom
|
I am having this problem. I have checked my database and most of my field types are INT (11) but searches always do LIKE '*?*'.
How can I change this?
|
siread1
Založený: 14.11.2009
Príspevky: 2
Zaslal: 2009-11-14 16:28
Návrat hore
Odpovedať s citátom
|
Gah! After searching for ages I make a post then immediately discover the answer!
'select' => 'N'
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|