Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-07-2012, 10:34 AM
Kesstryl's Avatar
Kesstryl Kesstryl is offline
Member
 
Join Date: Feb 2012
Posts: 125
Gender: Female
Credits: 17,349
Kesstryl is on a distinguished road
Default Adding Databases

Is there any way to add databases, not tables, but whole entire databases? My hosting company limits my database size, and this will be a problem as the site grows, even with premium service which would give me unlimited amount of databases. I suppose transfering to a more expensive server option would do the trick, but as I'm a hobbyist right now with no way to pay for that, regular hosting is all I can afford at the moment. I like my company because it is very in-expensive and a green hosting company, plus I'm familiar with their tools.
Reply With Quote
  #2  
Old 06-07-2012, 12:18 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,211
Hall of Famer is on a distinguished road
Default

umm it is possible, the database class is not singleton so you can instantiate as many database objects as you want.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 06-07-2012, 03:03 PM
Kesstryl's Avatar
Kesstryl Kesstryl is offline
Member
 
Join Date: Feb 2012
Posts: 125
Gender: Female
Credits: 17,349
Kesstryl is on a distinguished road
Default

OK thanks, sorry, I am not an expert in these things. I'll have to look up how to do this
Reply With Quote
  #4  
Old 06-08-2012, 12:30 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 333,211
Hall of Famer is on a distinguished road
Default

Well it is not difficult to instantiate database object, here is how the current database connection is carried out:

PHP Code:
try{
  
$adopts = new Database(DBNAMEDBHOSTDBUSERDBPASSPREFIX);
}
catch(
PDOException $pe){
  die(
"Could not connect to database, the following error has occurred: <br><b>{$pe->getmessage()}</b>");  

The database object accepts five arguments in its constructor, the database name, host, username, password and prefix. You can instantiate as many database objects as you wish by using this syntax below, which assumes that the database name differs but everything else remains the same

PHP Code:
$db1 = new Database(DBNAME1DBHOSTDBUSERDBPASSPREFIX);
$db2 = new Database(DBNAME2DBHOSTDBUSERDBPASSPREFIX);
... 
Hope this helps.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #5  
Old 06-08-2012, 06:47 AM
Kesstryl's Avatar
Kesstryl Kesstryl is offline
Member
 
Join Date: Feb 2012
Posts: 125
Gender: Female
Credits: 17,349
Kesstryl is on a distinguished road
Default

thanks :) I appreciate this
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Theme PokeFerno Questions and Supports 3 05-13-2014 03:47 PM
Adding new adoptables? Slix Questions and Supports 0 07-05-2011 11:12 AM
adding images Nemesis Questions and Supports 11 04-10-2011 11:00 AM
Adding Picture SJC Questions and Supports 3 05-19-2009 12:24 AM
Adding levels lady jive Questions and Supports 3 03-29-2009 06:18 AM


All times are GMT -5. The time now is 04:22 AM.

Currently Active Users: 9777 (0 members and 9777 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636