DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • May 19, 2013, 04:58:12 AM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1]   Go Down
  Print  
Author Topic: new $session['user']['something']  (Read 1057 times)
0 Members and 1 Guest are viewing this topic.
artti
Member
Captain of the Guard
***
Offline Offline

Posts: 164



View Profile
« on: February 17, 2010, 07:13:59 AM »

Is it possible to create new $session['user']['something'] without adding new field in MySQL and call it whenever I need it. Where I should put in code? Common.php? Pageparts.php? Somewhere else?
Logged
Brendan
I am Brendan.
Mod God
*****
Offline Offline

Posts: 823


View Profile
« Reply #1 on: February 17, 2010, 08:06:55 AM »

When calling $session['user'] the second part, example(['gold']) is a field from accounts in MySQL, so calling on something that is not in the MySQL, wont work.
Logged
Edward
Mod God
*****
Offline Offline

Posts: 592

Now... Who's a Llama?


View Profile
« Reply #2 on: February 17, 2010, 09:12:51 AM »

Is it possible to create new $session['user']['something'] without adding new field in MySQL and call it whenever I need it. Where I should put in code? Common.php? Pageparts.php? Somewhere else?

In theory, you'd just have to add it in to the database, under the user table. :-). You wouldn't have to put it in to the code anywhere, unless you wanted it to be called there.
Logged
Boris735
Mod God
*****
Offline Offline

Posts: 532


View Profile
« Reply #3 on: February 17, 2010, 10:08:00 AM »

The question is why you would want to, though.  If you just want to attach some extra data to each character, write a module and give it a preference for that data.  This trivially extends to more than one piece of data.
Logged
Talisman
Administrator
Mod God
*****
Offline Offline

Posts: 5427



View Profile WWW
« Reply #4 on: February 17, 2010, 10:17:02 AM »

Is it possible to create new $session['user']['something'] without adding new field in MySQL and call it whenever I need it. Where I should put in code? Common.php? Pageparts.php? Somewhere else?

In theory, you'd just have to add it in to the database, under the user table. :-). You wouldn't have to put it in to the code anywhere, unless you wanted it to be called there.

And then the installer will remove that field added to the user table on the next update. 

Have to be careful what you suggest...
Logged

Play the latest beta version here on DragonPrime
artti
Member
Captain of the Guard
***
Offline Offline

Posts: 164



View Profile
« Reply #5 on: February 17, 2010, 10:46:56 AM »

$session['user']['homecity'] = $homecities[$session['user']['race']]

Something like that... I'm just putting together multiple cities.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
$100 raised this year
Your help is greatly appreciated!
Who's Online
19 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search