NancyJ
02-05-2008, 05:10 PM
I've just discovered a strange bug with a new client's site, it wasn't noticed because everything seemed to be working fine.
The client has 'friendly' urls and it was greedily capturing too much for the id number. I've fixed that but I'm confused as to why it was working.
eg. this query:
SELECT *
FROM attika_properties
WHERE id = '329/Villefranche--Cap-Ferrat-Property'
Now the id = 329 but that record comes back correctly. The only thing I can think of is its because the id is being quoted as a string (good thing too, since it is incorrectly a string) and mysql is somehow, rather cleverly understanding what is being meant.
The client has 'friendly' urls and it was greedily capturing too much for the id number. I've fixed that but I'm confused as to why it was working.
eg. this query:
SELECT *
FROM attika_properties
WHERE id = '329/Villefranche--Cap-Ferrat-Property'
Now the id = 329 but that record comes back correctly. The only thing I can think of is its because the id is being quoted as a string (good thing too, since it is incorrectly a string) and mysql is somehow, rather cleverly understanding what is being meant.