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, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience:  M.S. in Internet Information Systems
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

**For The Doctor** help with a group project

This answer was rated:

**For The Doctor** help with a group project

Hello again! Thank you for requesting me.

Please provide details. If you have files that you need to share, please zip them up and upload them to

Once uploaded, you will be given a link on the right. Click on the 'Copy Link' option and then paste it here.

Thank you

Customer: replied 4 years ago.


I need to do the highlighted part in the file MyGroupProjectPart the other word document is just instructions for the whole project in case you have a doubt. You will notice that classmate who did the first part made a wonderful job. He got 100% in his individual project.

Hello again.

It never ceases to disappoint me how horrible many instructors are.

Your classmate should have received D at best.

1.) Every page that uses a the database creates a new database connection in that file itself.

The first professional PHP site I ever worked on had bout 2000 PHP pages. Imagine if a "good" developer got out of college and then went to work and created 2000 PHP files over the course of many years and created a new database connection, with the host, username, and password XXXXX in to each and every page.

Now imagine that the company changes host addresses or other connection parameters. You have just created a MASSIVE company issue that will cost a ton of money to correct. With your project, the site could expand as large as it needs to be and updates would require changing a single line of code. Your classmate's would require thousands of lines to be altered.

2.) He used a table for a form. That is very 1995 and violates the basic concepts of web design and the current W3C recommendations for good web design.


3.) His database does not have any primary key on two of the tables. That is a violation of 1st normal form, or the very most basic rule of relational databases. It is a HUGE error. It is actually going to pose an issue with your part. It is difficult to delete a record that has no ID. And the sentEmail records are supposed to refer to the record. It is impossible to make reference to a record that has no ID. So the database is complete rubbish. I will have to alter it.

Simply put. This site is bad. Very bad. In the real world, your classmate would get a talking to. It is very likely that he will at some point. They teach you a lot of bad habits in college. Usually because the instructors are such horrible developers.

But it is what it is. By when do you need this?

Customer: replied 4 years ago.

Yeah, I also noticed some of your points. But we should please the professor but if there is something that violates the established rules you may make changes just make comments. Do you think you can have it ready for Wednesday night or Thursday? if not just let me know. Take your time. Also, let know if there is any additional fee from your part. Anyway I always give you tip, but just in case. I want you happy and well paid.

I will have it ready for you well before that.

I just also noticed that the offer and request tables appear to join the register table on a varchar field, which is very bad practice. And, because there are no keys, there is no referential integrity (no foreign keys).

I've been through college and graduate school a few different times. This is F work.

I must make changes to the database. I will make comments. But the changes are going to require that the tables are empty. So your classmates will have to delete everything from their database. It is the only way to make your part actually work.
Customer: replied 4 years ago.

This fellow created his tables based on his individual project database. My classmates do not have anything yet, I am the only one because I am doing the second part.

Apparently, you have to already be logged in if you want to register to use the site. I guess I'll just insert a user for myself directly into the database.

I'm shocked your instructor didn't give a 0% for that right there. (It is impossible to register and log in).

Anyway. I will contact you when this is all complete.
Customer: replied 4 years ago.

I have to login using the school credentials and then register(only once). I tested that part and worked as indicated in the instructions. In order to register you must be in the school network. You can not do it. Remember this project is not a real web, is fake.

I realize that. I have commented out the LDAP code.

I will contact you once everything is complete.
Hello again!

You can download the completed changes here:

You will find a file called necessaryAlterations.sql

They are absolutely necessary in order to meet the requirements in your part of this project. The in no way alter the way that this other individual's site works. It is simply that we must have keys on the fields so that we know which to delete or accept.

We also need to be able to tell if an offer or request belongs to the logged in user. To do that, we need correctly set up foreign keys in order to assure referential integrity.

And, of course, we need the sentEmail table.

I've added comments to all of it. It is very easy to understand. Without these changes, your part really will not work.

So, with these changes, your part is completely done. I used the same style as the individual who made this site, so your instructor should be happy. I had to add email to the registration because the email requirements involve associating an email address to a user, not just a request or offer. The email must be on the registraiton record in order to meet that requirement. The sql file alters the registration table in order to add teh registration field. To continue using any existing accounts, you will need to update them to have an actual email. So, for instance, if you have an account called Milt, you would want to do something like:

UPDATE registration SET email = '[email protected]' WHERE username = 'Milt';

With the changes, you can now delete a offer or request record if it was entered by the user who is logged in. So if you are logged in as the user who entered the request, you will see a delete option. If you are not the user that logged in, you will see an accept option.

Clicking delete simply deletes the record.

Clicking accept generates an "email" to both the logged in user and to the email address on the offer or request.

And by "email" I mean entries are made into the sentEmail table, as per the instructions.

So that's it. That meets the requirements of your part to the exactly, to the letter. I did everything in the same style as the individual who created the site. To accomplish this, I altered or added:


Let me know if you have any questions. I'm here to help.

Please remember to rate my answer. Thank you so much!
Customer: replied 4 years ago.

Let me know when you are online

I am online.
Customer: replied 4 years ago.

I am getting this error when I try to send you a message let see if this one pass

Access Denied

You don't have permission to access "" on this server.

Reference #18.75881ab8.1366835933.521cea3

I have nothing to do with the web site. If you have technical problems, you can contact customer support [email protected]

I completed your entire part exactly as you requested. Please let me know what else you need.
Customer: replied 4 years ago.

Let me try again;

I have a question that may sound silly, but I wanted to make sure before I test the program. In necessaryAlterations we have DELETE FROM apartmentoffers; and DELETE FROM apartmentRequest; Do I need to enter this statements just like this without telling the database what I am deleting?


You need to spend $3 to view this post. Add Funds to your account and buy credits.
TheDoctor and other Homework Specialists are ready to help you
Customer: replied 4 years ago.

I deleted the tables and created them and made all the changes that you gave me in the file.sql. However, when I input offers or requests I do not get the email. The delete option works but the accept option is not showing up on the browser. In other words everything works except the emails and functionality of accept offer/request. I tried to compare of what we did in my last project but could not figure out. It seems to me that a link is missing. I am sending screenshots, open the link below.

Please send me the document with your part again. But upload it to appears to be having issues.

Paste the link here once it is uploaded.
Customer: replied 4 years ago. and Not Loging screenshots.docx


Let's look at the requirements.

1.) There is no requirement for an email to be sent when you input an offer or request. That is nowhere in the highlighted parts.

2.) Please read the requirements. The accept link only shows up for REGISTERED users. The requirement state "Registered Users can also accept rental..."

So the fact that you do not see an accept link after you have logged out of the site is perfect. That is exactly what should happen. Only registered users can see the accept link.

However, the "Registered User" must be a user other than the user who entered the offer or request. So you must be logged on, but as a different user than the one who entered the request. It doesn't make sense for a user to accept their own offer or accept their own request. It also does not correctly test the functionality.

3.) No email will ever be sent. Please view the instructions. No emails are to be sent and you are not to create the functionality for emails to be sent. When you accept an offer, two entries are made into the sentEmails table. No emails are to be sent, per the instructions.

So most of your screenshots are not valid, as the instructions clearly state that you must be logged in as a registered user.

If you log in as a user other than the user who entered the offer or request, you will see the Accept link. However, it is actually missing from the search page. I will add it to that page.
Here is the search apartments file:

Replace your file with this one. Now the apartment search will have the delete or accept link, depending on who you are logged in as and who entered the record in the first place. If it is your record, you can delete it. If it is a different user's record, you can accept it.

If you are not logged in, you can do neither.
Customer: replied 4 years ago.

The moderator of the group wants me to add the other part that we did not do and wants me to fix some errors that she gets when accepts the offer/request. I also noticed that the emails are not being stored in the sentEmail table. She wants me to remove the select statements and put the email in session variables ans pass it to insert statements. But I do not want to do anything unless you give me the OK. I highlighted in blue the part that I need to add. See link below.

Those "errors" are caused by the statement not succeeding in the first place. It is "false". That means that the database schema that your moderator is using is not the schema that I have. The prepare statement is failing and returning false. It does that when you attempt to use a column that doesn't exist, or some other database issue. Which means that someone did not successfully apply the database changes that I provided. Those pages work perfectly if the database is set up correctly. The fact that the page is stating that the statement is a boolean means that the database is not set up correctly. I couldn't even begin to tell what her "error" is without seeing her database schema. She would need to completely dump her database and send it so that I can see it.

The pages DO insert into the sentEmail table. However, with the prepare statement failing, no inserts are occurring, obviously. Again, this is due to the prepare failing, which is not displayed in the errors. She needs to do a complete export of her database and send it over. That way I can see where she screwed up.
Customer: replied 4 years ago.

These screenshots were taken on my computer using my database. I forgot how to make copy of the cmd database.

It appears that every prepare statement in those files are failing. So either the database is massively incorrect on your system or the connection parameters is wrong in those files.

Open up acceptRequest.php

Go to this line:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')");

Change it to:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')") or die (mysqli_error($conn);

And make certain that the connection information is correct at line 34. Then try to accept a request again. This time, the page will die and display why the prepare statement is failing.
Sorry, that should be:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')") or die (mysqli_error($conn));

I missed a left parentheses

Let me know what the die message is for the prepare statement. You can also do this on the mysql command line:


Please use the \G instead of the semicolon.

Send me the die statement and the command line results from the create table statement.

The prepare is failing, which means that there is something wrong with that table. Perhaps you forgot to type in the default CURRENT_TIMESTAMP ?


Also, the blue highlighted part in the requirements that you just sent me are not in the requirements that you previously sent me at all. I have both copies open.


I look forward to hearing back from you.

Customer: replied 4 years ago.

You did not send what I really, really needed, which is the die statement for that prepare. The warning on the bind are completely useless.

Doing this should take less than a minute. On line 55, you will find:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')");

Change it to:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')") or die (mysqli_error($conn));

Then, when you attempt to approve a REQUEST. You will get a white page with a message.

I need that message.
Customer: replied 4 years ago.


I hope is this...

No. Did you type in or die after the semicolon? There is now a parse error.
Customer: replied 4 years ago. New Photo

Hello again,

The error is very obvious. It is due to your wonderful team mate who created the database in the first place. Who apparently granted access to each table within the database instead of granting your web user access to the database itself. I have never seen anyone grant access to each table independently. It is horrible practice and leads to things like this. The error you're getting is because the user does not have access to this new table. In contrast, my user on my computer has access to the entire database because that is the sane way of doing things.

So, you see, there are no errors in the database or the code. It is simply that the GRANTS are set up really poorly. Run this on the command line (assuming you are logged in as root):

GRANT SELECT, INSERT, UPDATE, DELETE ON kmandadi.sentEmail TO 'kmandadi'@'localhost';

Though, most people would have done:

GRANT SELECT, INSERT, UPDATE, DELETE ON kmandadi.* TO 'kmandadi'@'localhost';

In the first place so that any new table in the database would be reachable from the web app.

Your team mates will have to run this additional GRANT command also.

Now for the blue part. As I mentioned, the blue highlighted part was not in the original requirements that you sent me at all. I can implement this additional functionality, but it is not part of what you requested in this question. I have both the original document you sent open and this new one. The blue-highlighted part does not exist in the original. The requirement isn't in the document at all.

For items that were not part of your additional request, I am required to kindly request that you enter a new question. Please remember to start it with **For TheDoctor**. And let me know by when you will need this additional part.

Thank you

Customer: replied 4 years ago.

I understand I will make a new request. Yeah I was changing the credentials manually it seems that is going to work. But let you tomorrow, because it is bedtime.

I look forward to hearing from you. Have a good night.