sparkiegeek
Noobie

Posts: 29

|
 |
Make DB queries easier to mod
« on: January 14, 2003, 05:26:46 PM » |
|
I've written a mod that needs to add an extra field to the db query in Load.php->LoadUserSettings() shown below (all one line) $request = mysql_query("SELECT passwd, realName, emailAddress, websiteTitle, websiteUrl, signature, posts, memberGroup, ICQ, AIM, YIM, gender, personalText, avatar, dateRegistered, location, birthdate, timeFormat, timeOffset, hideEmail, ID_MEMBER, memberName, MSN, lngfile FROM {$db_prefix}members WHERE memberName='$username' LIMIT 1;"); At the moment it searches for the entire line and replaces it, adding my fieldname to the end of the SELECT. This makes my mod pretty incompatible with other mods that need to add their fieldnames. Would it be possible to switch the oneliner to three lines similar to the requests in Profile.php? $request = mysql_query(" SELECT passwd, realName, emailAddress, websiteTitle, websiteUrl, signature, posts, memberGroup, ICQ, AIM, YIM, gender, personalText, avatar, dateRegistered, location, birthdate, timeFormat, timeOffset, hideEmail, ID_MEMBER, usertitle, karmaBad, karmaGood, lngfile, MSN, secretQuestion, secretAnswer FROM {$db_prefix}members WHERE memberName='$user'");
That way mods can search for the FROM line and add their fieldnames before that, and the text "<search for>"ed wouldn't be changed and mods would play nicer with each other  Just an idea 
|