Skip to main content
Participant
September 24, 2012
Question

Inherited PHP site, having trouble with mySQL

  • September 24, 2012
  • 1 reply
  • 4448 views

So first let me start by saying that I'm very new to PHP files in general, and to mySQL. I have some experience with basic HTML and reasonable experience with C++ so I'm confident I'll learn my way around, but for now I seem to be hitting some roadblocks. Recently I inherited a few project websites as my responsibility at work. The individual that created the sites was independently contracted, and I have no means of communicating with them on how the site was implemented.

Where I'm at:

So I've been using dreamweaver to manipulate code here and there to make some minor changes to the site, but definitely not in the way Adobe intended. I know some extra effort on my part now will result in a much easier to edit website, so I've been trying to create a local "test" server and setup the PHP and mySQL appropriately. I installed XAMPP, followed the instructions listed here: http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html; and all my servers are up and running. I believe the issue I'm having now is importing the websites existing SQL file (can't find it anywhere), which I'm hoping will allow me to edit logins and permissions... that is, if I am understanding how all this works so far. Previously I was editing login information via simply changing the code in the PHP file and that was working okay, but I couldn't seem to add new logins this way; hence my desire to get things setup correctly now.

So, now that I've created a local "test" server and connected my index.php file to the mySQL database I am seeing the following errors in design view:

Notice: Undefined index: logout in C:\xampp\htdocs\Elliott_test_server\index.php on line 15

Notice: Undefined index: username in C:\xampp\htdocs\Elliott_test_server\index.php on line 20

Notice: Undefined index: username in C:\xampp\htdocs\Elliott_test_server\index.php on line 22

Notice: Undefined index: username in C:\xampp\htdocs\Elliott_test_server\index.php on line 24

Notice: Undefined index: username in C:\xampp\htdocs\Elliott_test_server\index.php on line 25

Notice: Undefined index: username in C:\xampp\htdocs\Elliott_test_server\index.php on line 26

Notice: Undefined index: njyur6543trwefgsbdhnfjr6u54yer inC:\xampp\htdocs\Elliott_test_server\index.php on line 27

Notice: Undefined index: username in C:\xampp\htdocs\Elliott_test_server\index.php on line 31

Notice: Undefined index: username in C:\xampp\htdocs\Elliott_test_server\index.php on line 35

The bulk of these lines correspond with user logins in the PHP file. My assumption is that the PHP file is seeking the SQL dadtabase that contains these logins, but I haven't the slightest clue where it's trying to pull this information from. Any help getting this set up correctly would be great. I'm sure I could be providing more information, but I'm not entirely sure what would be helpful since I'm still new to this.

Hope to hear from you guys...

This topic has been closed for replies.

1 reply

Legend
September 25, 2012

'I believe the issue I'm having now is importing the websites existing SQL file (can't find it anywhere),'

You need to login to the remote websites control panel and go to the 'databases' section. From the database section in the control panel you should be able to fire up phpMyAdmin. Select the tables from the database and 'export' them to your desktop (or folder of your choice on your desktop).

Next you need to 'import' the database tables into your local database set up via phpMyAdmin. Fire it up from xamp, create a new database (IMPORTANT: name it the same as the remote database). Once created 'import' the tables you 'exported' from the remote site by selecting 'import' in phpMyAdmin. Browse to database tables you downloaded and import them into you local database.

If you echo the remote set up then all 'connection' files to the database will be preserved. (YOU will have to open the database connections file (which should be in a folder which you will/should have downloaded while getting the site files for use locally) and make sure the user and password are set to the user and password required by your local version  of mySQL.

Participant
September 25, 2012

Darn, I really thought this seemed like my solution. Only problem is, there are no databases associated with the websites. I accessed the control panel > databases section and there aren't any databases. The sites function fine though so this definitely seems strange to me. The person that created the sites did mention that he tried to "simplify" everything before handing over the files. I'm thinking I just need to create a new database and go from there?

Legend
September 25, 2012

No databases?

Is there nothing at the top of your php pages that connects to a database like:

<?php require_once('Connections/conUsers.php'); ?>

I was a bit concerned that you said you have been altering the login information in the php page itself which would infer that no database is being used.

Can you post the php page here, obvioulsy change the passwords. Someone maybe able to say why it is you are getting the warning 'undefined index' message.

Creating a new data base is easy but then you have to create the login/user/password script too. Dreamweaver can do most of this for you.

If you Google creating login in Dreamweaver and have a look around you'll probably find enough information.

I don't know how recent the below instructions are but it might be worth going through if you decide to set up a login page from scratch:

http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7884a.html