ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

MySQL Syntax Question

(1/2) > >>

Stoic Joker:
Okay, so I managed to get myself roped into a development project involving a web portal/reservation system that is huge (300,000+ lines of code), that was previously worked on by 3 other people - All of which (of course) had radically different coding styles.

...And most of the code comments are in Portuguese.. Which would be ok...if the half of me that is Portuguese, could actually read Portuguese ... But apparently I'm not quite that good at being Portuguese ... So in a nutshell, I'm F'ed :D

Anyhow... One of the thinks that I keep running across in the code - aside from the insanely excessive use of the (select all columns) asterisk - is the equally infuriating excessive use of 'like' - Example:


--- Code: Text ---SELECT * FROM table WHERE id LIKE '$id'
...Which to me means 'Where like exactly this' because there are no %'s used to allow the search to fuzz. So my question is, is there by chance some vaguely/obscure reason for this seeming insanity, or is it really ~'like'~ just as dumb as I think it is?

mouser:
https://stackoverflow.com/questions/404226/sql-like-with-no-wildcards-the-same-as

Ath:
I'd say its just lazy/stupid programming, assuming (something like "database design"...) that 'id' is of numeric type, so LIKE isn't going to work on that anyways, ever. (unless when using this kludge...)

Stoic Joker:
Cool, thanks guys!

I had a feeling it was just totally borked (they actually used like on an integer), but being entirely self taught I thought it couldn't hurt to double check myself.

This project has been a total horror show. From finding 56 if statements in a row (Yeah...) to finding if, if else, if else combinations that left no way of handling 'surprises' ... And much of the rest of the code is just total shit.

wraith808:
Hope you're getting paid hourly...

Navigation

[0] Message Index

[#] Next page

Go to full version