[AppDB] Now User Preferences is Br0ck. (fix sort of?)
tony_lambregts at telusplanet.net
tony_lambregts at telusplanet.net
Wed Jan 12 21:39:19 CST 2005
tony_lambregts at telusplanet.net wrote:
> It seems that adding a new user now works and so does editing a version.
> So thats the good news. The bad news is that user preferences is still
> broken with Current CVS. It gets a little farther and display's the
> versions box, but I get the following error message on my system (line
> 35 of db.php is a blank line .. go figure)
>
> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
> allocate 68254 bytes) in /var/www/html/appdb/include/db.php on line 35
>
> Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
> allocate 136 bytes) in Unknown on line 0
>
> I am tying to test this out but it sure is not behaving right.
>
> --
>
> Tony Lambregts
>
This patch fixes it on my system. the wierd thing is that on my system I have.
define("APPS_DB","apidb");
and
define("USERS_DB","apidb");
So why would it make any difference?
Change Log: fix up user preferences screen.
Files changed: preferences.php include/db.php
-------------- next part --------------
Index: include/db.php
===================================================================
RCS file: /home/wine/appdb/include/db.php,v
retrieving revision 1.9
diff -u -r1.9 db.php
--- include/db.php 12 Jan 2005 20:17:16 -0000 1.9
+++ include/db.php 13 Jan 2005 03:31:07 -0000
@@ -13,6 +13,21 @@
return $hResult;
}
+function query_userdb($sQuery,$sComment="")
+{
+ global $huserdbLink;
+
+ if(!$huserdbLink)
+ {
+ $huserdbLink = mysql_connect(USERS_DBHOST, USERS_DBUSER, USERS_DBPASS);
+ mysql_select_db(USERS_DB);
+ }
+ $hResult = mysql_query($sQuery, $huserdbLink);
+ if(!$hResult) query_error($sQuery, $sComment);
+ return $hResult;
+}
+
+
function query_bugzilladb($sQuery,$sComment="")
{
Index: preferences.php
===================================================================
RCS file: /home/wine/appdb/preferences.php,v
retrieving revision 1.13
diff -u -r1.13 preferences.php
--- preferences.php 12 Jan 2005 16:22:55 -0000 1.13
+++ preferences.php 13 Jan 2005 03:31:07 -0000
@@ -17,7 +17,7 @@
function build_prefs_list()
{
- $result = query_appdb("SELECT * FROM prefs_list ORDER BY id");
+ $result = query_userdb("SELECT * FROM prefs_list ORDER BY id");
while($r = mysql_fetch_object($result))
{
//skip admin options
More information about the wine-patches
mailing list