Forum Moderators: open

Message Too Old, No Replies

What should I do with these information? I am lost, please help.

what to create in the database

         

aced84

7:07 pm on Nov 27, 2009 (gmt 0)

10+ Year Member



Hi there,

I was trying to figure out what should I do with these information listed below.

Should I create a table of database? If so, how should I do that? I am totally lost and need some help from you guys. :(

<?php
@require (dirname(__FILE__) . '/split-settings.php');
$con = mysql_connect($settings['db_host'], $settings['db_username'], $settings['db_password']);
mysql_select_db($settings['db_name']);
?>

rocknbil

7:34 pm on Nov 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps you could tell us the root of the problem? "What do I do with it" doesn't give much to go on.

What you have there (I believe) is a CONSTANT, __FILE__, defined in a configuration somewhere, or **possibly** __FILE__ is used a a "marker" to swap out whatever value is requesting the page containing this code. That is, if echoed, you might get

/server/path/to/split-settings.php

What split-settings.php does, apparently, is build an array called "settings" which if echoed might look something like this:

db_host => 'mysql.example.com',
db_name => name of the database to use
db_username => 'database user name',
db_password => 'database password for the above user'

Then it selects the database for use in these programs.
mysql_select_db($settings['db_name']);

Overall, in combination with the configuration file, this snippet is used to connect to a mysql database for whatever programs it's included in, log in this user, and select the database to use. That's what it does, now what is the question or problem? :-)

aced84

7:48 pm on Nov 27, 2009 (gmt 0)

10+ Year Member



Hi rocknbil,

Thanks for the prompt reply, and you're right, my question was missing! LOL

Actually I have this file software that I wanted to put into my own hosting account. I have uploaded it into my server. However, when I tried to access into the URL where I put the file on, it asked for my username and password. I don't know where is the installation guide, but I figured out it's because I have not yet set up a database for this software.

I am a dead man when it comes to database. I have no idea on where to start configuring...

aced84

12:21 am on Nov 28, 2009 (gmt 0)

10+ Year Member



Hi again, rocknbil,

Can I upload this to mediafire, and let you have a look for me on how to set up the whole thing properly? If you're going to charge any amount, please let me know about it.

Thanks a lot.

rocknbil

4:51 am on Nov 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



^ ^ That would only be a half decent idea **if** your site is hosted on "mediafire." (whatever that is.)

Start with this:

I have this file software that I wanted to put into my own hosting account.

A little more detail: name of software, who it's made by, version if possible . . . odd you don't have manual access.

I have uploaded it into my server. However, when I tried to access into the URL where I put the file on, it asked for my username and password.

As in brought you to a page for U and P? Or did it ask for a database as well? Most online packages have a setup step. They will generally require you enter the name of the database, the database user, and database password. They generally can automate it from there.

The way you'd do this is

- Log in to your control panel for your hosting account
- Look for databases icons or links.
- Create new database, name it.
- Create new database user, at which time you will be prompted to choose a password for the database user.

This will be the info you would enter, if we're talking about the same thing.

aced84

5:00 am on Nov 28, 2009 (gmt 0)

10+ Year Member



Hey rocknbil,

Thanks for the help but I had just found a person who were able to guide me along the database creation process.

Anyway, thanks for your help. Appreciate it :)