PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Donovan
Client


Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Sat Jan 29, 2005 9:35 am Reply with quote Back to top

I am wanting to move my MILPACS tables outside of the nuke database for a separate backup purpose.

I have seen several ways to do this but am asking what is the preferred way?

Do I need to create an includes folder and separate config.php for database connectivity outside of Nuke?

What is a config.inc.php, and how is it different from a config.php


Here is what I am thinking and what I have found in other modules.


Code:
<?php
if(eregi("_config.inc.php", $_SERVER["PHP_SELF"]) || eregi("_config.inc.php", $HTTP_SERVER_VARS["PHP_SELF"])) die("Access denied!");

// ################################### DATABASE SETTINGS  ##############################
$sql["hostname"] = "localhost"; // Hostname of the MySQL-Database
$sql["username"] = "xxxxxxx"; // MySQL Username
$sql["password"] = "xxxxxxx"; // MySQL Password
$sql["database"] = "xxxxxxx"; // MySQL Database Name

?>


Would I then have to code in include(config.php) to each of my pages?
View user's profile Send private message Visit poster's website ICQ Number
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

PostPosted: Sun Jan 30, 2005 12:09 pm Reply with quote Back to top

config.inc.php is just "standard" way of letting the programmer (and user) know that it is an included file and means nothing as stand alone. Functionally there is no difference; you could call your config file "donovan.php" if you wanted to.

Now, on the other, a bit more detail is needed.

What exactly is your goal and why?
Will it still run under nuke?
If it will still run under nuke, why not use nuke's config.php?
Any other detailed information that might help.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Donovan
Client


Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Sun Jan 30, 2005 2:58 pm Reply with quote Back to top

Backup of the modules database tables as well as a cleaner install of Nuke as to not have so many "aftermarket" tables that are added with different modules.

vWar is such an application that runs in Nuke just fine with an external database as well as Nuke Treasury. I have both of their tables in their own db.
View user's profile Send private message Visit poster's website ICQ Number
Donovan
Client


Joined: Oct 07, 2003
Posts: 735
Location: Ohio

PostPosted: Sat Feb 05, 2005 8:39 pm Reply with quote Back to top

I made a db.inc.php file just for this purpose and was going to include this in each of my files.

Code:

<?php

/************************************************************************/
/* MILPACS                                                           */
/* ===========================                                          */
/*                                                                      */
/* Copyright (c) 2005 by Steven Donovan                                */
/* http://www.3rd-infantry-division.net                                 */
/*                                                                      */
/*                                                                      */
/************************************************************************/

//connection string to MILPACS database
$db = mysql_connect( "localhost", "username", "password");
mysql_select_db( "database_name", $db);
?>


But now when I try to pull up my roster it was giving me a same crap as before

Quote:
Fatal error: Call to a member function on a non-object


Is there a specific place I have to write my include statement if it is not in a function?

include("db.inc.php");

Here is the line the error referred to.
$result = $db->sql_query($sql);

It has to be this variable $db that is not geting passed or something.
View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous 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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum