You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 40 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Mysql query in a block [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Allenh
Nuke Cadet
Nuke Cadet


Joined: Sep 08, 2005
Posts: 3


PostPosted: Thu Sep 08, 2005 7:05 am Reply with quoteBack to top

I am developing a game intergrated into php-nuke and am having trouble with a block i am trying to get to work.

I want to display user specific information within a block.

I am using the following code but i know thw sql query will only check for the 1st row in the table.

-----------------------------------------------------------------------------------
if (eregi("block-Ruler.php", $_SERVER['PHP_SELF'])) {

Header("Location: index.php");

die();

}
global $db, $user, $cookie;
// query to get user info
$sql = "SELECT * FROM nuke_users";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

$content .= ""._BWEL."<br><b>$row[username]</b><br><br>\n";
$content .= "Level: $row[current_level]<br>\n";
$content .= "EXP: $row[current_exp]<br><br>\n";
$content .= "AS Modifier: $row[as_modifier]<br>\n";
$content .= "DS Modifier: $row[ds_modifier]<br>\n";
$content .= "SPD Modifier: $row[spd_modifier]<br><br>\n";
$content .= "U-Credits: $row[uc]<br>\n";
$content .= "Food: $row[food]<br>\n";
$content .= "Energy: $row[energy]<br>\n";
$content .= "Alliance: $row[alliance]<br><br>\n";
$content .= "Ladder Points:<br>\n";
$content .= " $row[ruler_ladderpoints]<br>\n";
$content .= "Ladder Status:<br>\n";
$content .= " $row[ruler_ladderstatus]<br><br>\n";
$content .= "<a href=\"index.php\">Extended Stats</a><br>\n";

I need to access nformation of the user i who is logged into the site not the 1st row of the table. Who do i code the query?
Find all posts by AllenhView user's profileSend private message
Allenh
Nuke Cadet
Nuke Cadet


Joined: Sep 08, 2005
Posts: 3


PostPosted: Fri Sep 09, 2005 8:32 pm Reply with quoteBack to top

never mind i got it....
Find all posts by AllenhView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.426 Seconds - 426 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::