pulling data uit of database

Support for IntegraMOD 141

Moderator: Integra Moderator

pulling data uit of database

PostAuthor: Skywalker » Fri Jan 26, 2007 4:47 pm

Your phpBB Version: 2.0.
phpBB Type: Standard phpBB
MODs: No
Your knowledge: Beginner
Board URL: [url]http://[/url]

PHP Version:
MySQL Version:


What was done before the problem appeared?



What was done to try to solve the problem?




De.scription and Message

wich code do i need to use to pull some data out off the database lets say i want to display some text when a number of member is reached and i want to show the data from row max_users.

when i use:
Code: Select all
if ( $board_config['max_users'] == 100){*some code*}


or
Code: Select all
if ( $board_config['max_users'] == '100'){*some code*}

it will not work...
attention this is an example max_users can be replaced by something else
also it could be that on some pages this code will work
what i need is some other code that will do the same as this code suposed to do...

when i got this to work i can also finish 2 other mods i'm working on and when ready they will be released on integrmod
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

Re: pulling data uit of database

PostAuthor: Teelk » Fri Jan 26, 2007 6:33 pm

You can try something like this...

In the php file...
Code: Select all
$message = ($board_config['max_users'] == 100) ? sprintf($lang['how_many_users'], $board_config['max_users']);


Then in the $template->assign_vars(array do something like 'MESSAGE' => $message,

And put {MESSAGE} somewhere in the .tpl file.

Then you'll need a lang key...
Code: Select all
$lang['how_many_users'] = 'There are %s users allowed.';
The %s is where the $board_config['max_users'] would be shown.
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

Re: pulling data uit of database

PostAuthor: Skywalker » Fri Jan 26, 2007 6:44 pm

you have understand it wrong i think,
instead of
Code: Select all
if ( $board_config['max_users'] == 100)

i want some coding like
Code: Select all
$sql = " SELECT * FROM Ā "...
or something lik ethat, i have the right code for displaying the data also the right code to update the data only on that page i like to display the code
Code: Select all
if ( $board_config['max_users'] == 100)
seems not to be working so i need another code to pull it out of the db...
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

Re: pulling data uit of database

PostAuthor: Teelk » Fri Jan 26, 2007 6:51 pm

What specifically are you trying to pull out of the database?
Last edited by Teelk on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Teelk
Dev Team
Dev Team
 
Posts: 1309
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 14, 2006 6:25 pm
Cash on hand: 0.00
Location: Canada

Re: pulling data uit of database

PostAuthor: Skywalker » Fri Jan 26, 2007 7:00 pm

"Teelk";p="20462" wrote:What specifically are you trying to pull out of the database?

i need it for more then one mod basicly the exact data in the database like i said max_users is the number off users on the board lets say it is 200 i want to be able to extract that number and put it wherever i want also i'm busy making a mod to welkom lets say the 250st member.
there fore i need a code like the one i posted, if i got it for one mod i can edit it for the others, no problem.
my problem is just that the code posted above does not work for what i need it
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

Re: pulling data uit of database

PostAuthor: Skywalker » Mon Jan 29, 2007 3:01 am

*bump* can someone plz give me the other code i requested so i can work further on those mods?
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]