Question: So I have set up a mysql database that holds an image (more specifically a path to an image) and the images rank (starting at 0). I then created a web page that displays two images at random at a time. [Up till here everything works fine] I want my users to be able to click on one of the images that they like better and for that images rank to increase by +1 in the database.

How would I set that up? Please be as detailed as possible in your explanation. I am new to php and mysql.

Answer: 
I had a similar error as well. I am pretty sure it is a very low level database related issue. Here is some more information I have - 

a. With a inmemory database, I could run a test case with exactly the same data just fine.
b. When I got the error "-[\_\_NSCFNumber constantValue]: unrecognized selector sent to instance 0xa9e4ca0". I did 

```
(lldb) po 0xa9e4ca0
 $0 = 178146464 -96.24999189101783

```

Not sure where 178146464 coming from. I will try the manual "between" now.
At the beginning of your fetch you're declaring

`NSPredicate *predicateToRun = nil;`

And then you assign it a NSCompoundPredicate to it in

`predicateToRun = [NSCompoundPredicate andPredicateWithSubpredicates:[NSArray arrayWithObjects:longPredicate, latPredicate, nil]];`

See if that solves it.
Rog