How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask TheDoctor Your Own Question

TheDoctor
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1423
Experience:  M.S. in Internet Information Systems
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

Hi Doctor, I am enrolled in an online course "PHP and MySQL.

Resolved Question:

Hi Doctor,

I am enrolled in an online course "PHP and MySQL. I'm working on Assignment 2 and you provided the answer to someone in December 2012. I registered to join Just Answer and paid the fee to access your answer as it is locked. Would you be able to provide the answer to me?

I don't see any file number to give you, but the person's name was Terrance and you answered 100 days and 14 hours ago.

I would really appreciate your assistance as I am struggling with this course!
Submitted: 1 year ago.
Category: Homework
Expert:  TheDoctor replied 1 year ago.
Hello and thank you for using JustAnswer.
Could you provide me with the URL to the question that you are referring to?
Thank you
Customer: replied 1 year ago.

http://www.justanswer.com/homework/7e7db-hi-doctor-need-help-again-mysql-version-assignment.html?txsid=21736666&opt=10&archiveid=12420047&viewquestion=74027082

Expert:  TheDoctor replied 1 year ago.
Hello again,

I can work on this project for you, but I cannot give you a copy of the code from this other answer. You really wouldn't want it anyway, as you wouldn't want to turn in an assignment that a previous student had turned it. It is likely to be flagged. No two people write code exactly the same.

However, I can write this up brand new for you so that it is original work. By when is it required?
Customer: replied 1 year ago.

I agree, thank you and I would really appreciate that!


 


The assignment is due April 18th, but it would be beneficial to have it earlier so I can test it and be comfortable with it.

Expert:  TheDoctor replied 1 year ago.
Hello again,

I will have this to you by Tomorrow (Thursday) morning.

Thank you
Customer: replied 1 year ago.

Awesome - thank you very much!

Expert:  TheDoctor replied 1 year ago.
You're welcome.
Expert:  TheDoctor replied 1 year ago.
Hello again!

You can download the completed project here:


All requirements have been met and all of the code is fully commented. I promise that you will receive excellent marks.

You should be aware of the requirements for running a PHP project per your course instructions. I will go over them shortly just in case.

You cannot run a PHP file locally without having the appropriate environment in place. This means that if you open a PHP file up directly in a browser, it will never work. That is not how PHP works. PHP is a server-side language and requires a server to operate. In order to do this on your local system, you must be running a PHP-Enabled Web Server and the file must be opened through a localhost address, not opened directly in the browser. This can be accomplished with tools like WAMP or XAMPP. All of this should have been covered in your course.

These tools come along with MySQL, which you obviously need in addition to the Web Server. When running, you will have access to the phpMyAdmin tool. I have included a database.sql file with all of the code that you need to create and populate your database. You need to select the SQL option within phpMyAdmin and paste the contents of the database.sql file into the text area. Alternatively, you can select the "Import" option and browser for and select the database.sql file and then click "Go".

Once you have your environment set up correctly and the files placed in your web-root directly, you will actually be able to use the project. The first course in the list is already full. So if you attempt to register one of the students in that class, you will receive a message that the student is already registered or the class is full. For instance, if you attempt to register Martin Short, student number 1000, you will receive a message that this student is already registered. If you attempt to register Ryan Gosling, student number 1004, you will receive a message that the course is full.

Now, if you go to the last course in the list and register XXXXX XXXXX, student number 1005, you will receive a message that the student has been registered successfully. If you then attempt to do it again, it will let you know that the student is already registered for the course.

If you enter a bad student number, it will let you know that the student number is XXXXX If you input a valid student number but you do not enter the student name correctly, it will let you know that the student name does not match.

In short, this project meets every single requirement.

In the file, includes/database.class.php, you will see at the time is a series of variable definitions. These are your database connection string parameters. As you can see, it is currently set to localhost with a username or root and  a blank password. If your username and password XXXXX XXXXX this is where you would update it.

Keep in mind that the studnet name is XXXXX XXXXX

Please remember to rate my answer. It is the only way that I receive credit for my time and effort. If you require more assistance, simply continue our conversation before leaving any rating.

If you have follow-up questions about the project after you have provided a positive rating, please know that you may come back to this thread and I will gladly answer any question that you have.

If you require assistance with web development or database projects in the future, please feel free to request me directly by starting your questions with **For TheDoctor**

Thank you so much for using JustAnswer.  Have a great day!
Customer: replied 1 year ago.

Thank you very much for your quick response and assignment completion! I will work with it in the next few days and weekend to make sure I understand everything and get it working. I do have XAMPP and SQL installed on my computer. I will be in touch soon.


 


Thanks again and have a good night!

Expert:  TheDoctor replied 1 year ago.
You are very welcome. Please remember to rate my answer. Again, you may ask any follow-up questions at any time.

Thank you
Customer: replied 1 year ago.

I will remember to rate your answer - I'm looking forward to trying it out!


 


Thank you.

Expert:  TheDoctor replied 1 year ago.
You are very welcome. Have a great night.
Expert:  TheDoctor replied 1 year ago.
Hello again Nancy!

Let me know if you have has a chance to try out the site yet.

If you have any issues implementing it, just let me know. We can work on getting it set up together.
Customer: replied 1 year ago.

Good evening,


 


I tried the site last night and had some errors but I haven't had a lot of time to work on it. And tonight was hockey play-offs so just got home... busy times! I'll touch base with you tomorrow. I'll likely need your help.


 


Thank you.

Expert:  TheDoctor replied 1 year ago.
Hello again,

The site is completely error-free as far as I am aware. Whenever you are available, we can use screen sharing so that I can see exactly what is going on.

Thank you
Customer: replied 1 year ago.

Yes I'm not worried about that... I just have to make sure my SQL is running properly on my computer and make the changes you suggested in your earlier message and then see where I'm at. I just haven't spent enough time on it yet.


 


Thank you for your help!

Expert:  TheDoctor replied 1 year ago.
You are welcome. I look forward to hearing back from you.
Customer: replied 1 year ago.

Hello!


 


Yahoo - the assignment works perfectly! I had to get MySQL running first which took me a bit of time; then adjusted the files according to your instructions and it's a beautiful thing! Thank you very much.


 


Now I just have to complete 2 quizzes - one this week and one the following week and the course will finally wind down.


 


Again I appreciate your assistance!

Expert:  TheDoctor replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1423
Experience: M.S. in Internet Information Systems
TheDoctor and 5 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

Thank you again. If I run into any issues in April when I have to upload the files, will I be able to ask for your assistance? I doubt if I will, but just in case...


 


Have a great day.

Expert:  TheDoctor replied 1 year ago.
Absolutely. It if it related to this project, just come back to this thread and ask.
Customer: replied 1 year ago.

Excellent - thank you!

Customer: replied 1 year ago.

Hello I'm back! I need to submit my assignment by April 18. As per our instructions, I have to post individual files so I removed the files from the 'includes' folder and put them in the same directory as the index and took out the references to the folder. It works on my computer, but when I upload the files, I receive this error:


 


Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /var/www/htdocs/home/nancy/include.php on line 4



I'm not understanding the second part of our instructions for uploading which is likely the problem. Here are the instructions:


 


"Assignment 2 is due on Thursday, April 18. When you submit the assignment, you must use PHP to create and populate your MySQL tables on the assignment server. Your access to the Apache server is the same as for Assignment 1. The MySQL server is localhost. Your MySQL username and password XXXXX the same as your Apache username and password.


 


You have been granted full privileges to a database that has the same name as your username. For Assignment 2, user jack who accessed https://lamp.magcomputing.com/home/jack/ with password XXXXX for Assignment 1 will have access to a database named jack at the MySQL server named localhost using username jack and password XXXXX"


 


I've changed the username & password XXXXX database.class, but I still get the same error.


 


Do I need to rename my database? Should I be asking my instructor about the instructions or can you help me with this?


 


Thank you for your assistance.

Expert:  TheDoctor replied 1 year ago.

The project I gave you does not include code to automatically create and populate tables. You never gave me those instructions and they were not part of the instructions given by the previous question. Doing so is not a common practice with PHP. People usually create their databases using the DBMS, not PHP.

Doing so will require another script. Also, you cannot simply change the directory of the files and have them work. You would have to rewrite the include.php file. Even if you uploaded into separate folders, they are still "individual files".

So you need to rewrite include.php and you need to write a new script to create and populate the database.

 

You can download the altered project here:

 

Attachment: 2013-04-14_162949_withcreate.zip

 

There is a script called createTables.php

 

Open that file and change the username and password XXXXX the database so that it connects to your database server on your school's account.

 

Once uploaded, go to that file. Only go to it once. It will create the database and tables.

Customer: replied 1 year ago.

Thank you for the revised files! I uploaded the new files, inserted the username & password, then uploaded to the school account. Then I went to "createTables.php" and received this error:


 


Warning: mysqli_connect() [function.mysqli-connect]: (42000/1044): Access denied for user 'nancy'@'localhost' to database 'college' in /var/www/htdocs/home/nancy/createTables.php on line 15

Fatal error: Call to a member function multi_query() on a non-object in /var/www/htdocs/home/nancy/createTables.php on line 70



I'm sorry to bother you with this - I'm having trouble understanding it.

Expert:  TheDoctor replied 1 year ago.
Notice in the instrucitons that it states that you have access to a database that has the same name as your username. I will assume that is "nancy"

You cannot use the database called "college". You can only use "nancy" (assuming that is your actual user name).

Download this copy of the files:


Change the password XXXXX both the createTables document and the database.class.php file.

They are now set up to use a database called "nancy".
Customer: replied 1 year ago.


Awesome - thank you so much! Yes the username they gave me is "nancy". I will try this when I get home from work today.


 


I appreciate your assistance!

Customer: replied 1 year ago.

Hello again. I'm sorry to bother you, but my deadline is getting close. I've made all the necessary changes as you instructed but am getting these errors. Am I supposed to change anything in the "include.php" file?


 


Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /var/www/htdocs/home/nancy/database.class.php on line 12

Fatal error: Call to a member function query() on a non-object in /var/www/htdocs/home/nancy/database.class.php on line 21



My instructor sent me an email saying "include.php is trying to load Database.class.php which is not installed on the server. If you have Database.class.php on your test system, you will have to upload it and any other additional modules you used at home."


 


But I have uploaded all of the documents - I don't understand how to fix this issue.


 


Your assistance would be greatly appreciated!


Nancy


Expert:  TheDoctor replied 1 year ago.

Hello again, Nancy.

You do have Database.class.php installed. You see how the error is coming from database.class.php? It wouldn't say that if it wasn't installed.

The error that you are receiving is not a programming error. That error is coming from the database. It states in plain English what the error is.

The database is denying access for a user called root, who is using a password.

So it would appear that you opened the database.class.php file, changed the password, but left the user name as root instead of changing it to your user name. As I have stated previously, you need to change the username and the password XXXXX match your credentials. That file still has "root" as the user. Change it to your username instead and then upload it again.

Customer: replied 1 year ago.

This is what I have in my database.class.php and createTables.php (i removed the password XXXXX this note):


 


DEFINE("HOST","localhost"); //The Database host address
DEFINE("USER","nancy"); //The user name set on the database
DEFINE("PASSWORD","xxxxxx"); //The password XXXXX the database user
DEFINE("DATABASE","nancy"); //The database name


 


I reuploaded all of the documents and now get these errors:


 


Warning: include(Database.class.php) [function.include]: failed to open stream: No such file or directory in /var/www/htdocs/home/nancy/include.php on line 6

Warning: include() [function.include]: Failed opening 'Database.class.php' for inclusion (include_path='.:/usr/lib/php') in /var/www/htdocs/home/nancy/include.php on line 6

Fatal error: Class 'Database' not found in /var/www/htdocs/home/nancy/index.php on line 9



I'm sorry I'm not looking too bright - I'm still having a hard time with this course.


 


 

Expert:  TheDoctor replied 1 year ago.
Now that is a completely different error. It is saying that it cannot find the file Database.class.php

Rename the file to make certain that the file has a capital D. So the file name should be Database.class.php, not database.class.php

Then upload the file and try again.
Customer: replied 1 year ago.

YAHOO it's working!!! I also had to change helper.ca to Helper.ca. Thank you so much for your help - I really appreciate it!! I'll be able to sleep tonight!


 


Have a good evening,


Nancy

Expert:  TheDoctor replied 1 year ago.

No problem. Linux-based servers are case-sensitive. Windows are not. That's my fault. I apologize. Have a good night!

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience