I need to build a website which can authenticate users, present user specific information drawn from my own MySQL database. And I am trying to decide the best approach.
My understanding is, with wordpress I must have my database tables embedded in the wordpress database, but with Drupal I can use my own database. Is that true?
I can write php code to retrieve data from my own MySQL database but don't have much knowledge about user authentication, CSS, or even complex HTML. Given that, will I be able to accomplish my goal with Drupal? Is there sample project of this kind I can use as template/starting point? Or tutorial specific to this kind of website?
I am a newbie to all CMS and any advice is greatly appreciated.

Comments

nevets’s picture

While you could do that, it begs the question why use Drupal.

It would make more sense if you wanted Drupal to manage the data, as a content, entity or otherwise.

Jaypan’s picture

Trying to force Drupal to work the way you are used to is usually a lot of time, and ends up with a messy system. If you are going to use Drupal, you should learn to use it the way it's meant to be used, then build your system the Drupal way. Otherwise you're better off not even using it.

cltechsol’s picture

I just need to build a website which can authenticate users and display user specific information. I am not sure what is the best approach and searching the internet lead me to wordpress, joomla!, and drupal. If these are not the right approach, any suggestion? Or how should I use drupal the right way to achieve my goal? Thanks.

Jaypan’s picture

Drupal is an extremely powerful tool. But trying to force it to work your way, rather than learning to work the Drupal way, is asking for headaches and frustration.

If you are ready to drop what you think you know, and open your mind to a different way of doing things, Drupal is an extremely powerful tool. Otherwise, I'd avoid it.

cltechsol’s picture

I am ready to drop what I think I know. Can drupal authenticate user and serve each user specific data pulled from a MySQL database, which can be updated independently by other programs? If yes, is there tutorial or template specific for this kind of project? Thanks.

Jaypan’s picture

>Can drupal authenticate user and serve each user specific data pulled from a MySQL database, which can be updated independently by other programs?
Yes, yes and yes.

The easiest way to figure out what is going on with Drupal is either to read a book (or rather a few books on it) and follow what they are doing to get a feel for how things work, or to do a video course on it for the same reasons. You can also look at the documentation here on Drupal.org (https://www.drupal.org/documentation), but I personally don't find it to be as good a resource. And finally, be prepared to spend some time. Drupal is extremely powerful, but it also has a pretty steep learning curve. You'll want to get a good bit of understanding under your belt before you actually start on the project you want to work on.

yelvington’s picture

I am ready to drop what I think I know.

Great first step! Many programmers try to wedge "my way" into Drupal rather than using Drupal's way. For example, you don't use mysql_* functions to query the database; you use the database API. You don't use curl, you use drupal_http_request(). You don't write forms in HTML, you use the form API. The reasons may not be immediately apparent, but they're real and the benefits of using the framework will become apparent as you gain an understanding of the system.

Can drupal authenticate user and serve each user specific data pulled from a MySQL database, which can be updated independently by other programs?

That's what Drupal is, basically. An extensible application, an API, and a database.

Depending on the complexity of your existing data model, you might be able to remodel the data using Drupal's existing tools (nodes, other entities, the Data module, etc.) and migrate your data into Drupal. The benefit of doing that is that you immediately gain access to other powerful Drupal tools, such as such as the Views system. If you need to interact with the data externally, the Services module can expose a robust API.

cltechsol’s picture

Thanks a lot for the information. Is there tutorial or sample project for specifically this kind of site development?

nevets’s picture

The key to this project seems to be "present user specific information drawn from my own MySQL database"

So depending on what the per user specific data is there are different approaches one my take.

So what type of per user data are we taking about?

cltechsol’s picture

In mySQL database I have tables containing each users assets, transaction history, and any other information related to that particular user I can extract from the database using mySQL procedures. So I will need functions that takes user id as input and return tables filled with required information. For example, if the user is logged in (authenticated), there is a "my transaction" button/link. When user clicks on that, a table will be displayed listing his transactions (date, amount, etc.)

nevets’s picture

How does the data "get" in the tables. The only way for the user id to match up is if the data is entered in Drupal, otherwise how would Drupal know how to match up user ids?

It seems to me if you really want to use Drupal, the data would be stored in Drupal, by Drupal and you would use content types or entities to represent the rows of data and views to display it. In this case you do not directly manage the tables.

cltechsol’s picture

I wanted to use Drupal to only display the data, preferably not having write permission to the tables at all. Because I have other scripts to create and update the data. User data would only appear in database after user register on website, so in that case I was hoping I will have userid already (created by Drupal?). Is that doable?

nevets’s picture

See comment by Jaypan.

You are hanging on to a particular way of doing things.

Jaypan’s picture

Exactly. You generally shouldn't even need to be aware of the DB in Drupal. Also when building sites in Drupal, you don't integrate your original scripts, you build functionality in Drupal that either mimics the functionality of your original scripts, or achieves the same goals in a different manner.

WorldFallz’s picture

Is it doable? yes, of course. Drupal is php so anything you can do with php you can do with drupal, its api, and custom php.

The question really is-- "should it be done with drupal?" And as others have already pointed out, unless you're willing to embrace drupal fully, then no, based on what you describe, drupal is not the right choice. You can probably come up with something using laravel or symfony faster than you would with a hacked up custom drupal.

Insisting on using drupal in the way you describe will result in nothing but frustration for you where you will still end up either doing it the drupal way or abandoning drupal anyway-- only after wasting weeks or months of head banging.

Do yourself a favor-- make the decision to use drupal or not now. Save yourself the head banging weeks/months.

bander2’s picture

Let me try to point you in a direction. You are going to need to familiarize yourself with Drupal in order to get this done, but I have been where you are and I know that at this point you may not want to invest the time in reading books on a solution which you are not convinced is right for you.

In Drupal you do most of your work in the UI and you never directly interact with the database. You model your data in Entities with Fields.

A "User" is a type of entity, so a solution for what you are doing might be to recreate the data representation that you currently have in your database as fields on the User entity.

For more complex data, you may need to create multiple, related Entities. Some of these might work well as Taxonomy, others might be Content (aka Nodes). Both of these are types of Entites.

If the Entities that come with Drupal do not meet your needs, you can define your own, or use modules that define new ones for you. If you are defining your own, you can do it with code, or with the module Entity Construction Kit. 2 Modules that I think may be helpfull are Profile2 and Field Collection.

Whatever you choose, the idea is to model your data in Drupal Entities. Then you can import the data using the Feeds module. And then you throw your database away because Drupal is managing the data.

You are on a Drupal forum, but I consider myself pretty unbiased. My take is that Drupal is a great solution for this project. I don't know of any CMS that is going to let you hang on to your database, and modeling this kind of data is a foreign concept to Wordpress and Joomla. The best thing about Drupal is the community. So when you have questions about modeling your data (and you will), we are here to help.

If you are married to your database, there are solutions for you, but Drupal isn't one of them. Using a web framework, like Laravel and Symfony, you can probably keep your schema. The downside is that you need to build the authentication system and authorization system yourself (and all the markup and a bunch of other stuff).

- Brendan

bander2’s picture

I just want to address this point:

... which can be updated independently by other programs?

Again, you are not messing with the database directly and neither should any program. Depending on specifics, the Services module or the Feeds module will provide the API for your integration.

- Brendan