MyBB Requests

How would I do this shit -- mybb & mysql make table and blah blah blah

Submitted by Blowjob, , Thread ID: 3219

Thread Closed
Blowjob
Closed Account
Level:
0
Reputation:
26
Posts:
2.16K
Likes:
189
Credits:
2.53K
26-04-2015, 08:31 AM
This post was last modified: 26-04-2015, 08:32 AM by Blowjob
#1
How would I make a function (MyBB) to create a table in the database, save different data per user, and then extract that data when I need to?

Hold on let me explain this better



How would I create a table in the mybb database, that would save $var1 in it but it would be different for every user

$var1 would be different for every user but default until my script changes it, it would be "blah"

and when my script changes it $var1 would change from being "blah" to "bleh" but it would only be that for that user unless someone else choice "bleh"


i need to store data in a seperate table in the mybb database

the data will be different for every user but on default til it is changed will be "blah"
and how would I get my script to change that data for that user?

RE: How would I do this shit -- mybb & mysql make table and blah blah blah

Sozin
Nan Ihier Gelair Mordor
Divine
Level:
0
Reputation:
91
Posts:
2.33K
Likes:
374
Credits:
11K
26-04-2015, 08:36 AM
#2
You need to a plugin...

function hug_activate ()
{
global $db;
$db->query( 'ALTER TABLE '.TABLE_PREFIX.'users ADD `pomf` AFTER `uid`' );
}

function hug_pull()
{
global $mybb;
echo $mybb->user['pomf'];
}

function hug_push()
{
global $db;
//Assuming you have value of $var1 through solme form's POST/GET request
$db->update_query( 'users', array( 'pomf' => $var1 ), '`uid` = '.$GLOBALS['mybb']->user['uid'] );
}
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.

RE: How would I do this shit -- mybb & mysql make table and blah blah blah

Aoki
retired
Level:
83
Reputation:
348
Posts:
7.89K
Likes:
2.3K
Credits:
1.7K
26-04-2015, 02:08 PM
#3
Someone tries to copy our color changer. :yus:
1

RE: How would I do this shit -- mybb & mysql make table and blah blah blah

Blowjob
Closed Account
Level:
0
Reputation:
26
Posts:
2.16K
Likes:
189
Credits:
2.53K
OP
26-04-2015, 02:14 PM
#4
26-04-2015, 02:08 PM
aoki Wrote:
Someone tries to copy our color changer. :yus:

:rly:nope.

Users browsing this thread: 1 Guest(s)