Select value from table where varname = '3 different things''
Discuss Select value from table where varname = '3 different things'' in the MySQL Help forum on Dev Shed. Select value from table where varname = '3 different things'' MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
Posts: 159
Time spent in forums: 19 h 23 m 37 sec
Reputation Power: 30
Select value from table where varname = '3 different things''
I have a table that I am trying to select the info from the value column where the varname column equals illegalusernames, minusernamelength & maxusernamelength.
Something like:
Code:
"SELECT value AS illegalusernames FROM ".TABLE_PREFIX."setting WHERE varname = 'illegalusernames'"
"SELECT value AS minusernamelength FROM ".TABLE_PREFIX."setting WHERE varname = 'minusernamelength'"
"SELECT value AS maxusernamelength FROM ".TABLE_PREFIX."setting WHERE varname = 'maxusernamelength'"
I want to do this without having to pull 3 different queries.
Posts: 1,837
Time spent in forums: 1 Month 2 Weeks 1 Day 5 h 25 m 30 sec
Reputation Power: 811
Quote:
Originally Posted by r937
actually, how about adopting it?
Great. So we'll have 100 configuration tables with 50 columns each and some hack to prevent more than one row being inserted? Lovely, that's so much better than this bad, bad key value approach. Let's tell those damn amateur developers of Drupal, Joomla, Magento and whatnot that they've got it all wrong.
Seriously: I do understand your concerns from an academic point of view. But this is about real life. And this sometimes means that practical issues are more important than having a textbook perfect data model.