Jump to content


Photo

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


  • Please log in to reply
15 replies to this topic

#1 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 28 September 2006 - 05:59 AM

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.

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 28 September 2006 - 02:48 PM

Are you getting any errors in any log files?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 28 September 2006 - 04:11 PM

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?

#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 28 September 2006 - 06:32 PM

Not really... you must be getting errors somewhere.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 29 September 2006 - 04:59 AM

When trying to access the home page with a browser, the site simply won't come up. Where would I look for the errors? Is there a server error log file somewhere?

#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 29 September 2006 - 05:08 PM

You're getting a blank page? That's definitely PHP-related... I don't know how to turn errors on explicitly, though.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#7 NevadaSam

NevadaSam
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationUSA

Posted 29 September 2006 - 11:56 PM


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


#8 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 30 September 2006 - 07:54 AM

Here's the SQL script:



#9 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 30 September 2006 - 08:03 AM

Actually, I con't seem to upload the script! I sent it to you by email, Sam.

#10 NevadaSam

NevadaSam
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationUSA

Posted 30 September 2006 - 11:55 AM


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.


#11 NevadaSam

NevadaSam
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationUSA

Posted 30 September 2006 - 01:36 PM

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


#12 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 02 October 2006 - 12:38 AM

Sam,

I'm still having trouble attaching or even pasting the code into my replies. I did email you the script however.


#13 NevadaSam

NevadaSam
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationUSA

Posted 02 October 2006 - 02:16 AM

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 <?php instead of <?. 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. http://nevadasam.zoo...s.com/index.txt

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 connection.php 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.

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

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


#14 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 02 October 2006 - 09:21 PM

Sam,

You're right about the settings in the "connection.php" file. They're still set to the old server.
I'll correct this, and let you know how it turned out.

#15 pbase

pbase
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 07 October 2006 - 12:03 AM

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


#16 NevadaSam

NevadaSam
  • Members
  • PipPip
  • Member
  • 26 posts
  • LocationUSA

Posted 07 October 2006 - 01:22 AM

I am glad you are headed in the right direction now.
Good luck with your site.

Sam





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users