Welcome, Guest. Please Login or Register.
May 09, 2025, 03:37:36 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Make DB queries easier to mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Make DB queries easier to mod  (Read 439 times)
sparkiegeek
Noobie
*
Posts: 29


Make DB queries easier to mod
« on: January 14, 2003, 05:26:46 PM »
Reply with quote

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 :D

Just an idea :)
« Last Edit: January 14, 2003, 05:43:39 PM by sparkiegeek » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Make DB queries easier to mod « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.037 seconds with 20 queries.