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, 118 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 - Help adding extra to my info 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
jasonrhl
Corporal
Corporal


Joined: Jun 27, 2004
Posts: 62


PostPosted: Tue Sep 06, 2005 1:15 pm Reply with quoteBack to top

I have a trivia that writes to mysql and I want to show peoples scores on the main information block (Site Visitors on nukecops).

I have tried this

Code:
   $trivia_score_user = $db->sql_query($db->sql_query("SELECT scores
FROM ".$prefix."_scores WHERE nickname = '$uname'"));

   $content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"10\"
width=\"14\"> "._tscr.": <b>$trivia_score_user</b><br>\n<hr>\n";


but it enters nothing from the database. When I do it in phpmyadmin it works fine. I have tried changing $uname to be a user that I know has a score. I use this in phpmyadmin
Code:
SELECT scores
FROM scores WHERE nickname = 'user2'




If someone could help a little further I would like it to show 0 or no score if a player has never played. If they have not played their name would not be in the nickname field of the database.

I have never coded in php or mysql before so if I am totally wrong I wouldnt be surprised.
Find all posts by jasonrhlView user's profileSend private message
jasonrhl
Corporal
Corporal


Joined: Jun 27, 2004
Posts: 62


PostPosted: Sat Sep 10, 2005 4:40 pm Reply with quoteBack to top

After a few days of breaking

I now have this

Code:
$trivia_score = $db->sql_query("SELECT scores FROM scores WHERE nickname = 'trivia1'");

    $content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"10\" width=\"14\"> "._tscr.": <b>$trivia_score</b><br>\n<hr>\n";


I now get the result on the block

Trivia: Resource id #205

Some how $trivia_score = Resource id #205

The result should be

Trivia: 48


Very Happy
Find all posts by jasonrhlView user's profileSend private message
gotcha
Private
Private


Joined: Mar 21, 2004
Posts: 42


PostPosted: Sun Sep 11, 2005 1:48 pm Reply with quoteBack to top

try this out

Code:

$trivia_score_query = $db->sql_query("SELECT scores FROM ".$prefix."_scores WHERE nickname='trivia1'");
$trivia_score_row = $db->sql_fetchrow($trivia_score_query);

    $content .= "<img src=\"images/blocks/ur-anony.gif\" height=\"10\" width=\"14\"> "._tscr.": <b>".$trivia_score_row['scores']."</b><br>\n<hr>\n";

_________________
Advanced Nuke Backup
Map Manager
Find all posts by gotchaView user's profileSend private messageVisit poster's website
jasonrhl
Corporal
Corporal


Joined: Jun 27, 2004
Posts: 62


PostPosted: Sun Sep 11, 2005 10:56 pm Reply with quoteBack to top

you champ
Find all posts by jasonrhlView 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 - TUTTISU E-COMMERCE http://www.tuttisu.it
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: 3.949 Seconds - 191 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::