Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  avoid sql LIKE in "Search" mode

phpMyEdit General     avoid sql LIKE in "Search" mode
Post new topic   Reply to topic    
 
uioreanu     Joined: 09 May 2006   Posts: 1  
Post Posted: 2006-05-09 15:26
Back to top  Reply with quote     

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     Joined: 07 Jun 2006   Posts: 1  
Post Posted: 2006-06-07 18:13
Back to top  Reply with quote     

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     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2006-06-08 09:43
Back to top  Reply with quote     

http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.basic-options.html#AEN830

 
siread1     Joined: 14 Nov 2009   Posts: 2  
Post Posted: 2009-11-14 16:25
Back to top  Reply with quote     

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     Joined: 14 Nov 2009   Posts: 2  
Post Posted: 2009-11-14 16:28
Back to top  Reply with quote     

Gah! After searching for ages I make a post then immediately discover the answer!

'select' => 'N'

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy