Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-07-2005, 11:26 AM easy question
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
Hi!

I would like to ask if I have understood something about databases correct. One site requires a database to function for example a phpbb forum or a cms site that use php and mysql. This means that if I want to have 2 such websites, 2 different installations, I need to different databases. Is that correct?

I am looking forward for replies, I just need to know if I have understood this correct.
Thanks in advance.

Cheers.
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
 
Register now for full access!
Old 06-07-2005, 11:41 AM
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Hi,

Your exactly right, you will need to have two seperate databases. However, in some cases you may use only one database, but you will have to have alot of experience with databases because you may overwrite some data with the new data. And besides, your hosting company usually gives you access to unlimited SQL databases (or more than one). I would prefer to use one database for EACH program.

Hope I was clear with that.

-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 06-07-2005, 12:05 PM
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
Yes you were clear! This is the way I thought it would be too. Thank you very much for your reply!
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
Old 06-07-2005, 12:08 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
When you install phpbb for example, it asks you for a table prefix, default is 'phpbb_'. If you install twice with a different table prefix then you can run two message boards from one database.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 06-07-2005, 12:17 PM
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
Oh wow, thats very interesting, maybe I will try it when I have more experience... you have a cool signature oberon, I dont understand a thing! But looks like php.. which I am going to learn soon... hopefully!
Thanks for your reply!
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
Old 06-07-2005, 12:46 PM
0beron's Avatar
Defies a Status

Posts: 1,832
Location: Somewhere else entirely
Trades: 0
It's a quine - it prints it's own source code, including the bit doing the printing. Bit pointless really.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';

Please login or register to view this content. Registration is FREE
(aka MSN handwriting for forums)
0beron is offline
Reply With Quote
View Public Profile Visit 0beron's homepage!
 
Old 06-08-2005, 02:39 AM
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
Hello again,

I just found out that my host (a friends host actually) only gives him a mysql database of 150 MB. And they told him, he can create whatever tables he likes within this allocation. If we want to set 2 different or more sites now, how do we do it? We cant just use the same database name. I am sure, it wont work. If anyone knows how we should go about with it?

I ve never used databases before, only html. I also downloaded a client called MySQL Administrator, but cant figure out anything about tables in there. Now I will try to download this other program called phpmyadmin.

If anyone knows how this would work or have any advice or even just links please post them, I am very confused and wish so much to learn.
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
Old 06-08-2005, 03:40 AM
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
You can't use 1 database for 2 sites. There will most probably be a conflict. Database of 150MB? Thats big. I think its a 150MB account where you can create many database in it. Might need to recheck. To use MySQL Administrator, you have to do some setting on it. Make sure it connect to where your given MySQL account reside.
waller is offline
Reply With Quote
View Public Profile
 
Old 06-08-2005, 03:55 AM
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
Well, why would they give one big database if we cant use its full potential? I also thought initially that we can make many databases. I think it must be possible with the new table prefix to handle different sites from one databases. I read this also in the mambo cms forum. I just have to find out HOW .... google is my friend...

What mostly worries me is that I am doing things, following instructions about databases, hearing about tables, without really understanding the philosophy and function of them. And especially this seems to be difficult to find out through google.
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
Old 06-08-2005, 05:46 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
of course you can use 1 database for as many sites as you wish. Just be aware of the table names and maybe add a prefix if you have the same app running on different sites.

I have several small shopping carts in one database all using the same named tables, just a three letter prefix, so there is

abc_products
def_products
xyz_products

in the one DB

and I use MySQL-Front as a client. For SQL newbies it has a SQL command display so you can learn SQL while using it and try the W3Schools SQL tutorial.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-08-2005, 08:24 AM
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
Thanks Chris for your reply, this is good news. I also found out how to change the prefix in mambo cms that interests me too. I will definetely try the program you sugested me. In fact just yesterday I visited w3schools and started to look in the php and sql tutorials. They write that there are different versions of sql but I guess I can learn some basics there. Its totally new to me but also very fascinating! Thanks again!
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
Old 06-08-2005, 09:19 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Each version of SQL servers have their own dialects MS for instance has T-SQL (Transactional SQL), But provided you write your queries in ANSII SQL it should work across all SQL servers
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-08-2005, 09:49 AM
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
OK cool, thats good to know!
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
Old 06-08-2005, 09:20 PM
waller's Avatar
Skilled Talker

Posts: 59
Location: North Borneo.
Trades: 0
Ah, sorry there allmagica. chrishirst was right. U can use 1 database for more than 1 site as long as you are carefull with the tables....Its a good feeling learning new things.
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
waller is offline
Reply With Quote
View Public Profile
 
Old 06-09-2005, 02:32 AM
allmagica's Avatar
Skilled Talker

Posts: 79
Trades: 0
No problem waller! we live we learn
allmagica is offline
Reply With Quote
View Public Profile Visit allmagica's homepage!
 
Reply     « Reply to easy question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45683 seconds with 12 queries