NukeXchange Network

          

Nuke Sites Link Directory
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
·Dynamic block height
·Full Path Changes Required in Several Directories
·Members Cant Logon My Site or View Forums & Member Profi
·versign and authorize.net phpauction integration...
·Approved Membership for 8.0
·I want to use full HTML content in the welcome page...
·Changed style from subsilver, folder images now dont display
·Installing the forum upadates
·PHP-Nuke SQL Injection Vulnerability Fix
·Warning: main(db/mysql.php): failed to open stream: No such

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: domainforsale
Today: 0
Yesterday: 0
Overall: 14887

Visitation:
Guests: 488
Members: 0
Total: 488


You are Anonymous user. You can register for free by clicking here
Sponsor Links
Nuke Sites Link Directory
Nuke Sites Link Directory

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: 1784




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 148 unique hit(s) in the past 24 hours.
Forums ©
Need to find your IP fast?


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.32 Seconds

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