Jump to content

SQL Database, Index.php don't like each other…


pbase

Recommended Posts

I'm a real novice at dealing with PHP and SQL databases, so I'm hoping that someone more knowledgeable can give me a bit of help.

I pulled all the files from a commerce site, written mainly in PHP, from another server and transferred it to Godaddy. I created a database using their tools, and uploaded the SQL file I pulled from the old server into the new database.

But the homepage, index.php, won't come up. I'm sure something somewhere needs to be changed. What's the most likely error? I'm assuming it's some sort of conflict between the index.php file and the SQL file.

Any help would really be appreciated.
Link to comment
Share on other sites

When I uploaded the SQL file I got from the other server, there was a "user not permitted" type of error as the file attempted to create it's own database under a different name.
I removed those lines, and that particular error went away.

Would it help If I were to show you the script?
Link to comment
Share on other sites


Your first problem is you have a GoDaddy account. ;D;D I am not a big fan as I have almost a year left on an account that I am not using. If you script was written for PHP 5, you will have to rename your files index.php5 on that hosting service.

If you script does not have anything too sensitive or personal you can post it or email it to me as I to have access to their site and can get it to work.

Sam
Link to comment
Share on other sites


pbase, what you sent me was the mysqldump. This is the information used to recreate a database onto a new server. Thanks. I am new to this stuff also and will learn a lot from this experience.  I am going to use the information you sent to go back into my unused GoDaddy account and create what you have. This will take a while but we will learn this together.

From your orginal post when you mentioned "script" I thought that you were having a problem with your index.php script and I thought that was what you would be posting or sending. If you have successfully recreated the db and are having a problem with the index.php, please cut and paste it here so others can view your php code. Before you post, be sure to xxx out your login name and actual password from the code.
Link to comment
Share on other sites

OK, I created a database and uploaded your dumped file. I did not get any errors and all seems good. Your data seems to be only test data you create so perhaps it is not senistive material as I thought.

Does you index.php access the db from the start? If so be sure your login information matches. Even if you do not successfully connect to the db you shouldn't get a blank page. I will need to see the index.php script to know anymore.

Sam
Link to comment
Share on other sites

The weekend was my best time, but let's see what we can do. Perhaps this will be enought to help. First I want to point out that while Godaddy does have short_open_tag set to On, it is not good pratice not to use them. Consider using [b]<?php[/b] instead of [b]<?[/b]. Probably the reason you could not post your index.php code was this fourm has a limit on how my lines of code can be posted. Normally one only needs to post the part they are having a problem with. Whenever you want to share more code you can upload it to a text file (index.txt) and it will be viewable from a link on your site. This is the code you emailed to me. [url=http://nevadasam.zoomcities.com/index.txt]http://nevadasam.zoomcities.com/index.txt[/url]

It looks OK and I am sure it is if it worked on the last hosting site. The next place to look is in your connection set up. The second line of your code is looking for a script name [b]connection.php[/b] in a sub-folder from where the index.php file is. This script brings in, (includes), the settings to connect to the database. Another pointer here is you may want to consider giving it a trickier name (the file and folder) for security reasons so no one can guess it. Do that after  you have gotten everything up and running.

[code]<?session_start();
include('include/connection.php');
[/code]

Make sure the username and password used in the connection.php is what you assigned to your GoDaddy database. And that the database where listed in the connection information is the same as what you are calling it now. From the control panel at GoDaddy find out what your connetion settings are. They are different than most hosting services. They don't use "localhost" I have different server names for the two database I have there. They are: mysql211.secureserver.net, and mysql119.secureserver.net. Yours may be different. ($host = 'mysql211.secureserver.net';)

This may get you in the right direction. Let us know how it goes.

Sam
Link to comment
Share on other sites

Samantha,

This simple problem stymied all of us. But thanks to your assistance, the site is now active!

dbboutique.com

It needs a bit of tweaking, but the hard work is done. I'm sure that in no time, you're going to be a wonderful asset to the PHP community.

Thanks again,
- Collwyn
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.