Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Executing queries

I have the following piece of code: http://pastebin.com/1CYsGKqM

Don't be scared to open, it is very short :)

But this part of code is not doing well. If i enter Azebaijan, New york , it returns true... What am i doing wrong?



84.6k

You have to return just one record from the query to expect a ┬┤false┬┤when it isn't returning a single record.



10.8k
Accepted
answer

Solved it this way :

  1. $countrycitytest = LocationTest::findFirst(array(
  2. "conditions" => "ccfips = '$enteredcountry' AND fullname_nd = '$enteredlocation'"
  3. ));