Jump to content



Welcome to KnowledgeSutra - Dear Guest , Please Register here to get Your own website. - Ask a Question / Express Opinion / Reply w/o Sign-Up!
- - - - -

Mysql Database Help


48 replies to this topic

#1 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 03 April 2005 - 09:40 PM

I just got hosted on Friday, and I just uploaded all the FTP files and SQL file. Now, I am losted at what to do. I thought since I uploaded all the files, it would work, but it doesnt. I am making a LUE2/OG-like site. You can help by posting a message here or emailing me or AIMing at mutatedmonkeycat. (AIM perfered..)

Edited by snlildude87, 09 April 2005 - 07:01 PM.


#2 JaVe

    Super Member

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 262 posts

Posted 04 April 2005 - 02:12 PM

So, it uses sql? Did you put it to the right adress a.k.a localhost (because it's hosted on trap's server). Btw, what is not working? What are the error messages? We need the details because it's like saying, my computer doesn't work, can you fix the problem. Details details...

#3 NilsC

    Administrator

  • Kontributors
  • PipPipPipPipPipPipPipPipPip
  • 377 posts
  • Location:USA

Posted 04 April 2005 - 09:47 PM

did you signup using gigapass.com like you said on your application?

1 you have not pointed your "DNS Record" nameservers to trap17 name servers yet. Until you do that I don't know how any of your data would be accessible. Your cpanel is accessible using the IP address only.

Quote

Your NS records at the parent servers are:

ns.kornet.net. [211.216.50.150] [TTL=172800] [KR]
ns2.kornet.net. [211.216.50.160] [TTL=172800] [KR]

[These were obtained from m.gtld-servers.net]

So until you update your NS record everything you do are in vain. :)

Nils

#4 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 08 April 2005 - 08:49 PM

There are no error messages, it just doesnt work. :\

I uploaded all the files, and when I try to go to my site afterwards (www.gigapass.trap17.com) it gets the "Welcome to your site!" thing. :\

NilsC, where do I put those numbers? >_>

#5 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 08 April 2005 - 08:54 PM

Also, what is the data base name?

#6 Argoth

    Newbie [Level 2]

  • Kontributors
  • PipPip
  • 29 posts

Posted 08 April 2005 - 09:57 PM

First, what folder did you upload your files to?
Next, your batabase name is USERNAME_ then the database name, er, at least I Think it is...

Also make sure that the index page is changed to be your index page not the index page that was on when you first got your account...

#7 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 01:10 AM

Argoth, on Apr 8 2005, 04:57 PM, said:

First, what folder did you upload your files to?
Next, your batabase name is USERNAME_ then the database name, er, at least I Think it is...

Also make sure that the index page is changed to be your index page not the index page that was on when you first got your account...

View Post



Er, I uploaded the files to seperate files. There are about 50 of 'em. I still dont know what the database name is, would it be USERNAME_trap17 (so really it would be dayzed_trap17?)

How do you change the index page?

#8 Argoth

    Newbie [Level 2]

  • Kontributors
  • PipPip
  • 29 posts

Posted 09 April 2005 - 04:12 PM

Go to, Cpanel click on file manager, click on the folder next to "public_http", click on index.html then click edit on the right. A window will open with the code to the index page.

Make sure that the files you uploaded are in the public_http folder or you won't be able to access them.

You need to make a database before you can access it. To make a database go to cpanel, click on MySQL Databases, type whatever you want to call the database in the textbox and click "Create MySQL database". Then create a new user to access the database. Click on "go back", scroll down to where it says "Existing MySQL Users", type a name for the new user there and a password. Click "Create MySQL user".
Now allow the user to change the database. Click "go back", scroll to where it says " Grant permissions on a MySQL database to a MySQL user" and choose the user you made and the database you made. make sure "ALL" is clicked under privileges then click "Grant Permissions".

The database name is then the "YOURUSERNAME_YOURDATABASENAME" and then your username is "YOURCPANELUSERNAME_YOURDATABASEUSERNAME"

#9 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 05:07 PM

I see no 'public_http.'

There is 'public_ftp' and 'public_html.' Thats it. :\

#10 snlildude87

    Moderator

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,325 posts
  • Location:Mawson, Antarctica

Posted 09 April 2005 - 05:13 PM

public_html is the one you should look in

Answer me this...what is the name of the first webpage people will see when they go to yoursite? If it's not index.htm, index.html, or index.php, then rename it to any one of those three, and delete the existing index.html in your public_html folder in your cpanel.

Edited by snlildude87, 09 April 2005 - 05:17 PM.


#11 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 05:30 PM

Okay, so I look in public_html?

The name of the first webpage is index.php.

#12 snlildude87

    Moderator

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,325 posts
  • Location:Mawson, Antarctica

Posted 09 April 2005 - 05:35 PM

Okay, now, look in your public_html folder. You should see an index.html file. DELETE THAT!

Next, upload your index.php file to your public_html folder.

Keep posting if you need more. :)

#13 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 05:36 PM

I think I got it! I have one more question before I procede, do I delete what is already in index.html (which I renamed to index.php), that states, "You wont do this, Welcome to your site, thank you, ect ect.'? Well, not delete, but remove it and place my code in its place...

#14 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 05:38 PM

Ignore my last post...

#15 snlildude87

    Moderator

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,325 posts
  • Location:Mawson, Antarctica

Posted 09 April 2005 - 05:40 PM

You can place your code in its (index.html) place, or you can delete index.html and upload your index.php file either way works because index.php takes precedence over the index.html file

#16 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 05:46 PM

Okay, thanks.

But, there is a couple more problems, where do I upload the rest of my site script? In a seperate file? I have about 30 more files I need to upload, all of which are needed. Do I do it in a seperate file than index.php or in the same one? There is a footer that is needed on all pages and none of the site works without it.

And uh, since your helping, you still want an admin position correct? Or are you doing this out of the kindness of your heart?

#17 snlildude87

    Moderator

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,325 posts
  • Location:Mawson, Antarctica

Posted 09 April 2005 - 05:54 PM

uploading all your files into the public_html folder should work. every file goes into your public_html folder.

being a moderator here is good enough :)

#18 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 05:58 PM

Yeah, it probably is. When the slow as heck dial up allows me to uploade my files, I will tell you how it goes.

If you make me blow it up, its your fault... :)

#19 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 06:05 PM

Also, I have a file called sql.sql. Do I put it in the same place?

#20 snlildude87

    Moderator

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,325 posts
  • Location:Mawson, Antarctica

Posted 09 April 2005 - 06:10 PM

It all depends. If you call sql.sql using an absolute link, then it shouldn't matter where you put it, but if you call it using a relative link, then you have to put it in the correct folder.

How do you call it in another file?

#21 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 06:14 PM

Whats an absolute link?



Okay, okay, I lied, not the last question....

#22 snlildude87

    Moderator

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,325 posts
  • Location:Mawson, Antarctica

Posted 09 April 2005 - 06:21 PM

Absolute is where you call your sql.sql file using the full path.
<?php
 include("http://blah.trap17.com/sql.sql");
?>
^ That's an example of an absolute call in PHP

<?php
 include("sql.sql");
?>
^ That's relative, and it will work ONLY if the calling file is in the same directory or folder as the sql.sql file.

#23 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 06:28 PM

I think I get what your saying, not sure though.


I tried moving it around, all over the place, and an error message comes up. Go to here to figure out what I'm talking about:

www.gigapass.trap17.com

I dont know what is wrong. I triple checked everything, and it seems to be correct....

#24 snlildude87

    Moderator

  • Kontributors
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2,325 posts
  • Location:Mawson, Antarctica

Posted 09 April 2005 - 06:33 PM

Well, I have 0 experience with MySQL because I find it to be unreliable - PHP never goes down.

What's the content of you config.inc.php file? Post the entire code (if it's not large) here

#25 Dayzed

    Member [Level 2]

  • Kontributors
  • PipPipPipPipPip
  • 78 posts

Posted 09 April 2005 - 06:37 PM

<?php
$_CONFIG['mbname']    = '';    // Giga Pass
$_CONFIG['mbsurl']     = '';    // [url=http://gigapass.trap17.com]http://gigapass.trap17.com[/url]
$_CONFIG['dbhost']    = '';    // trap17.com
$_CONFIG['homepage']   = '';    // [url=http://gigapass.trap17.com]http://gigapass.trap17.com[/url]
$_CONFIG['legal_tags'] = 'b|i'; // HTML tags allowed in messages. You can only add tags that have no attributes.
$_MYSQL['dbhost']      = '';    // localhost
$_MYSQL['dbuser']      = '';    // dayzed_ejashby
$_MYSQL['dbpass']      = '';    // (I put the password for dayzed_ejashby here)
$_MYSQL['dbname']      = '';    // dayzed_SQLdatabase

//
// User level definitions
//

define('Inactive', 0);
define('Warned', 1);
define('Mutie', 12);
define('Rookie', 15);
define('Veteran', 18);
define('Idol', 30);
define('Moderator', 52);
define('Administrator', 60);

//
// Include money (Coins) configuration. Go edit that file.
//

require 'mny_config.php';

$db = @mysql_connect($_MYSQL['localhost'], $_MYSQL['dayzed_ejashby'], $_MYSQL['(password for dayzed_ejashby)']) 
or die("<b>Error:</b> Failed to connect to database host: {$_MYSQL['localhost']}<br />
        <b>Possible Solution:</b> Check if the database host name, user name and password are defined
        correctly in the config.inc.php file.<br />
        <b>MySQL says:</b> ". mysql_error());

@mysql_select_db($_MYSQL['dayzed_sqldatabase'], $db)
or die("<b>Error:</b> Failed to select database: {$_MYSQL['dayzed_sqldatabase']}<br />
        <b>Possible Solution:</b> Check if the database is set up and the database name
        defined in the config.inc.php file is correct.<br />
        <b>MySQL says:</b> ". mysql_error());
?>
Where my password is supposed to be, I have my password, not the text.

Notice from snlildude87:
Placing your code in
 BBCodes makes it so much easier to read

Edited by snlildude87, 09 April 2005 - 06:43 PM.





Reply to this topic


This post will need approval from a moderator before this post is shown.

  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users