SELECT d.nomeDominio FROM dominioFccn d WHERE d.nomeDominio LIKE %''%;
we call ALL the values listed.
I was expecting to have NONE returned. :s
Why is that?
Why am I asking this? Because I would like to do:
$stmt = $this->_dbh->prepare("SELECT d.nomeDominio FROM dominioFccn d WHERE d.nomeDominio LIKE ?");
$stmt->bindValue(1, '%' . $dominioVo->getNome() . '%', PDO::PARAM_STR);
But each time getNome() is empty, I get ALL the values. :s
Can I have your help to find out a solution for this?
If I do LIKE %ABAY% will it find “ABAC” ? At this moment, he is finding. However, I’m not sure if this is a problem on my ss script, or a miss interpretation of LIKE.
Probably the first.
I cannot test it at the moment but I will once I get to the proper computer to do so. Unless, of course, I can get the answer from you. (I will test it still, so I believe… oh well… )
you have a front end programming language… use it!
pseudo-code:
[COLOR="Red"]if getnome() is empty
then[/COLOR]
SELECT ... FROM ...
[COLOR="red"]else[/COLOR]
SELECT ... FROM ... WHERE something LIKE '%[COLOR="Blue"]something[/COLOR]%'
[COLOR="red"]endif[/COLOR]