"Nothing" entered in the search gives error

A historical forum for issues reported in the suggestions and bugs forum that have been subsequently fixed or resolved.
Post Reply
User avatar
MatsP
Posts: 21038
Joined: 06 Oct 2004, 13:58
My articles: 4
My images: 28
My cats species list: 117 (i:33, k:0)
My aquaria list: 10 (i:8)
My BLogs: 4 (i:0, p:164)
Spotted: 187
Location 1: North of Cambridge
Location 2: England.

"Nothing" entered in the search gives error

Post by MatsP »

When using the Genus + Species search on the Cat-eLog homepage, if you enter "nothing" in both fields, we get:
Error: Query failed: 'SELECT clog_species.id, clog_species.species, clog_species.sl, clog_species.min_temp, clog_species.max_temp, clog_species.counter, clog_genera.genus, clog_families.family FROM clog_species JOIN clog_genera ON clog_species.genus_id = clog_genera.id JOIN clog_families ON clog_genera.family_id = clog_families.id WHERE;'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 11
Checking that EITHER species or genus has at least something in it should fix that.

--
Mats
User avatar
Jools
Expert
Posts: 16277
Joined: 30 Dec 2002, 15:25
My articles: 198
My images: 941
My catfish: 237
My cats species list: 87 (i:235, k:1)
My BLogs: 7 (i:10, p:167)
My Wishlist: 23
Spotted: 450
Location 1: Middle Earth,
Location 2: Scotland
Interests: All things aquatic, Sci-Fi, photography and travel. Oh, and beer.
Contact:

Re: "Nothing" entered in the search gives error

Post by Jools »

Good spot, I have fixed that now.

Jools
User avatar
MatsP
Posts: 21038
Joined: 06 Oct 2004, 13:58
My articles: 4
My images: 28
My cats species list: 117 (i:33, k:0)
My aquaria list: 10 (i:8)
My BLogs: 4 (i:0, p:164)
Spotted: 187
Location 1: North of Cambridge
Location 2: England.

Re: "Nothing" entered in the search gives error

Post by MatsP »

And, I'm sorry to say you broke the whole thing - any entry of any sort gives "no good, both fields empty".

--
Mats
User avatar
Jools
Expert
Posts: 16277
Joined: 30 Dec 2002, 15:25
My articles: 198
My images: 941
My catfish: 237
My cats species list: 87 (i:235, k:1)
My BLogs: 7 (i:10, p:167)
My Wishlist: 23
Spotted: 450
Location 1: Middle Earth,
Location 2: Scotland
Interests: All things aquatic, Sci-Fi, photography and travel. Oh, and beer.
Contact:

Re: "Nothing" entered in the search gives error

Post by Jools »

Code: Select all

$genus == "" && $species = ""
instead of

Code: Select all

$genus == "" && $species == ""
, doh! However my regression testing sucked.

Fixed now.

Jools
Post Reply

Return to “All Resolved Issues”