NukeXchange Network

          

NukeZone Hosting - Fast, Affordable and Dependable
Nuke Fixes · NukeForums · NukeZone Hosting · NukeUnited · Nuke Sites · Nuke Skins · NukeLance
Nuke Resources
 :: Home  :: Downloads  :: Your Account  :: Forums  :: Advertise :: 
Login or Register
Main Menu
General
 Main
 AvantGo
 Banner_Clients
 cfaq
 Donations
 Downloads
 Forums
 Members_List
 Private_Messages
 Search
 Stories_Archive
 Submit_News
 Surveys
 Topics
 Web_Links
 Your_Account

Your Account
 Login
 Register
 Lost Pass

Modules
Quick Links
· CMS Focus
· Domain Names
. Game Quest
· Learning Linux
. MateMaker
· NukeFixes
· NukeForums
· NukeLance
· Nuke Sites
· Nuke Skins
· NukeZone Hosting
. SearchDevil
Other Options

Download Resources
· Nuke Downloads
· Add a Link
· New Files
· Top Rated
· Most Popular

Web Site Resources
· Nuke Sites
· Add A Site
· New Sites
· Top Rated
· Most Popular

Support
· NukeZone Hosting
· NukeSkins.com
· NukeForums.com
· phpnuke.org
· NukeFixes.com
Information
NukeForums
·Need An Install
·Uzbek Language
·Cut and Pasting of Source Code.
·MYSQL ERROR HELP ME PLEASE
·does 7.9 not have a CAPTCHA (security code)?
·HTML Code Not Posting Properly
·Phorum module?
·Header not working....
·registration error
·Romanian SEO Agency??

read more...
Top10 Links
· 1: Nuke Forums
· 2: PHPNukeFiles
· 3: NukeSkins
· 4: Nuke Templates
· 5: EcomJunk
· 6: MDesign
· 7: Windows Installation: PHP
· 8: FLASH-FOR-NUKE
· 9: Dezina
· 10: Global Dream News Sharing Portal!
Site Visitors
User Login:

Nickname:
Password:
Security Code: Security Code
Type Security Code Here:

Members List Membership:
Latest: softdrpu
Today: 0
Yesterday: 4
Overall: 15040

Visitation:
Guests: 479
Members: 0
Total: 479


You are Anonymous user. You can register for free by clicking here
Sponsor Links
Need to find your IP fast?
Need to find your IP fast?

NukeResources :: View topic - Problem with custom blocks
NukeResources Forum Index

NukeResources Forum Index -> Bug Fixes -> Problem with custom blocks
Post new topic  Reply to topic    View previous topic :: View next topic 
Problem with custom blocks
PostPosted: Mon Mar 27, 2006 8:11 pm Reply with quote
FatherJuan
Resource Seeker
Resource Seeker
 
Joined: Mar 27, 2006
Posts: 1




First of all hello to all. My problem is that after I create my custom block, the blocks that follow after it seem to lose their database connection or something similar, I'm not quite sure. For example, if my custom block is weighted at 3 on the right side, my Surveys block weighted at 4 will come up with 'There isn't content right now for this block.' and the advertising block weighted at 5 will be completely blank.

Here is my code which just chooses a random picture url and name from a database and then displays them as a link to a module. The block works properly other than the problem with the blocks which follow it.

Code:

<?php

         

//if (eregi("block-rand_jezebel.php",$PHP_SELF)) {
//    Header("Location: index.php");
//    die();
//}

$hname="localhost";
$uname="bleah";
$pword="bleah";
$dbase="general";

// create connection
$conn = mysql_connect($hname, $uname, $pword);
if (!$conn) {
   die ("Couldn't connect to server : " . mysql_error());
   }

// select database
$db = mysql_select_db($dbase, $conn);
if (!$db) {
   die ("Couldn't select $dbase : " . mysql_error());
}


// sql statement to pull values
   $sql = "SELECT * FROM cams WHERE 'cam_name' !='' ORDER BY RAND() LIMIT 1";
   // execute SQL query and get result
   $sql_result = mysql_query($sql,$conn);
   if (!$sql_result) {
   die ("Couldn't execute query : " . mysql_error());
   }

while ($row = mysql_fetch_array($sql_result)) {

      $campic = $row["cam_url"];
      $name = $row["cam_name"];


}//endwhile


$content .= "<center><a href=\"http://fatherjuan.com/modules.php?name=Jezebels\" title=\"".$cam_name."\"><img src=\"".$campic."\" height=160 width=160 border=0><br>".$name."</a></center><br>";

// Free resultset
mysql_free_result($sql_result);

// Closing connection
mysql_close($conn);
?>


I hope that makes sense, any help would be appreciated.
View user's profile Send private message
PostPosted: Mon Mar 27, 2006 11:56 pm Reply with quote
Evaders99
Resource Master
Resource Master
 
Joined: May 25, 2004
Posts: 1785




Unfortunately phpNuke only creates one database connection. If you create a new one, it will overwrite it.

Can you not put your tables in the same database and use the phpNuke database abstraction layer?

_________________
- Star Wars Rebellion Network - Evaders Squadron Coding -

Need help? Nuke Patched Core, Coding Services, Webmaster Services
View user's profile Send private message Visit poster's website AIM Address
Problem with custom blocks
 NukeResources Forum Index -> Bug Fixes
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
All times are GMT - 4 Hours  
Page 1 of 1  

  
  
 Post new topic  Reply to topic     



Powered by phpBB © 2001-2005 phpBB Group.     Theme created by Vjacheslav Trushkin.
There have been 149 unique hit(s) in the past 24 hours.
Forums ©
Game Quest Online - Games and more!


Best viewed with a Browser
All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2001 - 2007 by NukeResources.com
You can syndicate our news using the file .backend.php or ultramode.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.38 Seconds

:: Eos phpbb2 style by Cyberalien :: PHP-Nuke theme by www.nukemods.com ::