Welcome, Guest. Please Login or Register.
May 03, 2025, 11:31:37 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  |  Not keeping variables that I know are there « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Not keeping variables that I know are there  (Read 798 times)
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Not keeping variables that I know are there
« on: April 20, 2002, 01:37:58 PM »
Reply with quote

Ok, I'm trying to update my mute users mod and write a new mod, and it's not keeping the $username variable that I know is there, nor the $ID_MEMBER. It's in the same function that uses the bloody variable and it says there's nothing in the variable. Here's the code I'm trying to use within ModifyMessage.php

$muteduser = mysql_query("SELECT muteduser FROM {db_prefix}members WHERE (memberName = '$username')");
$muteuser = mysql_fetch_row($muteduser);

Any ideas?
It gives me a mysql error saying that it's invalid, but the variable $username should be there!

First line of that function:
global $username,$ID_MEMBER,$currentboard,$yytitle,$txt,$color,$cgi,$imagesdir,$img,$threadid,$msg,$modSettings;
Logged
Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:Not keeping variables that I know are there
« Reply #1 on: April 20, 2002, 04:18:21 PM »
Reply with quote

Just make sure accessing $muteuser[0] as opposed to $museuser

because you have $muteuser = mysql_fetch_row etc.... $musteuser is an array - so you need to access $muteuser[0]

I just thought I'd make sure you were doing it - based on your variable names it appeared you might be trying to just access $muteuser
Logged

Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:Not keeping variables that I know are there
« Reply #2 on: April 20, 2002, 04:19:24 PM »
Reply with quote

wait - nvm.  make {db_prefix} {$db_prefix}

or else it would try to access a table name thats really odd
Logged

Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:Not keeping variables that I know are there
« Reply #3 on: April 20, 2002, 04:31:37 PM »
Reply with quote

crap I didnt even see that, thanks Joseph! :)

EDIT: Didn't help any though :-/
The username shows now, the query doesnt work though
« Last Edit: April 20, 2002, 04:34:56 PM by Anonymous Jedi » Logged
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:Not keeping variables that I know are there
« Reply #4 on: April 20, 2002, 10:20:40 PM »
Reply with quote

Ok, got that working, now it does it in another place (for a diff mod.)

I put this in the very bottom of Subs.php
if ($action == "change_mood") {
   $mood_chng = mysql_query("UPDATE {$db_prefix}members SET mood = '$mood', mood_filename = '$mood_fn' WHERE (memberName='$username')");
   }
It doesn't keep $username though, any ideas?
« Last Edit: April 20, 2002, 10:25:26 PM by Anonymous Jedi » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Not keeping variables that I know are there « 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.048 seconds with 21 queries.