How would I send information through different types of users through the use of databases?

So I want to make either a website or iPhone app and it will have 3 different types of users that all have different functions. I'll refer to these as user 1, user 2, and user 3. The lowest user, user 1, should be able to either take or upload a picture and send it with comments to user 2. My question is what would be the best way to implement this? How difficult would it be to do this with PHP for a web based application vs using Apple's Swift language for an iPhone app?

As for the database part, I know the app would require a database, but how would that integrate with the sending of info back and forth between the different user types?

Also, if I'm working with PHP, what would be the best way to go about creating the 3 different users with a login system? Are there any existing frameworks or tools out there that would do this for me, because I read that by doing it yourself you are bound to leave security holes open which would make it insecure.

There's no way to safely implement database use with apps, as NOBODY will allow a databsse port to be open to the Internet. That is a SERIOUS risk to the system. So web bassed using mysql and php is the only way to go. Considering this is for your own purpose you WILL need to write it ll yourself, and before you start you MUST study the mysql and php manuals, both available on line. Particularly data validation before accepting it from user input. Even a user name or password field needs to be filtered or a small piece of logic code in either field WILL give a hacker full control on your site with NO password. You also need to validate the file extensions of all uploaded files before accepting them, AND comparing that extension to the mime type of the file, or you will have posted attack scripts.

Use PHP session keys and authenticate against a database. It's far easier to implement this whole thing in PHP/HTML/Javascript you can use the bootstrap libraries too.

Although this is a different project, if you go through this tutorial you might find some helpful tips
http://www.ibm.com/developerworks/library/os-php-twitter-interface/

for the bootstrap libraries…
http://getbootstrap.com/

Using these will make your app work on any device