Here is the situation I'm in:
I just implemented a DNN site. I already have a huge database table of users. Now when my users come in to register for my DNN site, they're required to put in a first name, last name and DOB. I will then use this information to match their records to the existing user table via a SQL query. The only problem is I can't find "DOB" field anywhere, in any table or for that matter most of the rest of the profile information. Is it even stored in the database? or am I just blind?
The best answer I could find was from a dnn forum which stated
"User profile information is stored in several tables in the database. The 'Users' table is the place to start for basic information. There are several tables that have "profile" in the name that also are important."
I've looked through almost every table in the database, but with no luck...
I'm using DNN 6.0 with SQL Server 2008
I've looked everywhere but can't find it. Any help or guidance from anyone would be much appreciated! Even a paid solution like a pre-built module would work.
Thanks
Look in the ProfilePropertyDefinition table for the PropertyDefinitionId of the dateOfBirth property. Then, with that id, and the id of the user, you can query the UserProfile table to retrieve the value.
There is more at this blog post
http://erikvanballegoij.com/Home/itemid/28/Selecting-profile-properties-the-easy-way
Related
Good example will be shopify. Where you have N number of users (in this case each user assume site). And each user will have it's own records in DB. But db schema will be the same (same tables for each user, products, customers, orders etc.).
So question is what will be the best way to organize this kind of solution?
Store everything in one DB but in a different tables, or run separate DB for each user (but then will be question with maintaining, scalability and automatization)
possible solution:
We can use one DB with common tables like products, customers, orders etc. And we will have table users where we store records about each site.
In tables products, customers we will group all records by user_id.
This is one of possible solutions. But if we will have 1000 users (sites), each will have ~2k products, and ~100k customers, we can end up with tables which has millions of records, so questions will be:
how it will perform compare to each user (site) would have it's own DB?
how reliable this approach? bigger data, harder maintain, backup/restore
safety, if something wrong with one source thousands will be affected
Any links etc. will be much appreciated, thanks!
Create a mysql user for each tenant
Add a tenant_id column to each table
Add a view for each table that filters based on tenant_id = mysql_user
Use a trigger to automatically populate the tenant_id column on INSERT
Restrict the tenant mysql users to only access the views, not the raw tables
I wrote up a blog post on how I was able to convert a large single-tenant mysql application to a multi-tenant application in a weekend using this technique.
https://opensource.io/it/mysql-multi-tenant/
I recommend reviewing databases by well-supported open source solutions. With this in mind, here's a pretty simple schema I found real quick that'd explain a good working solution for this with scale-ability in mind.
http://www.zentut.com/sql-tutorial/sql-sample-database/
I have this file Generate_multiTanentMysql.php i do all steps with PHP script
https://github.com/ziedtuihri/SaaS_Application
Solution Design Pattern :
Creating a database user for each tenant
Renaming every table to a different and unique name (e.g. using a prefix ‘someprefix_’)
Adding a text column called ‘id_tenant’ to every table to store the name of the tenant the row belongs to
Creating a trigger for each table to automatically store the current database username to the id_tenant column before inserting a new row
Creating a view for each table with the original table name with all the columns except id_tenant. The view will only return rows where (id_tenant = current_database_username)
Only grant permission to the views (not tables) to each tenant’s database user Then, the only part of the application that needs to change is the database connection logic. When someone connects to the SaaS, the application would need to:
Connect to the database as that tenant-specific username
I am currently working on a project for myself and I'm creating a database for an Institute that helps students prepare for grade 12. I have thought about this topic for quite a while and did not have any efficient solution. However, I think if I added a field like "Entered by" in each table, it's datatype will be Lookup wizard. I will take the list from an admin table.
Look here for image
However this does not seem to be efficient since other users might be able to infiltrate the tables and change data. My apologies for my English and any lack of basic knowledge in access. I'm still a student.
Well, I found an answer, you just need to do it in a form. Have the login form opened and connect its value to where you need. For example, if you need the name of the user in the open login from, you just create an "Entered by" field and make its default value equal to forms!login!username.
I have to build this retail site, and aparently all the properties info comes from a third party company. Everything looked fine, they sent me a .mdb file with all the tables (which convert to a .sql file), and later I get emailed with data to update those tables.
What confused me was the fact that a few of these tables already have values in them. And when looking at the documentation, it says that I will also get emailed 'dictionary tables'. It says: "These tables contain fixed values in reference to value tables".
I have googled and searched here at stalkoverflow but couldnt find an answer. What I read was something about 'sas' and 'proc sql' which I haven't heard before.
Could someone please explain me (or kindly point me to some understandable documentation) what this tables are (are they in fact tables?), and how can I use them to build my site? I also use Codeigniter, can I use active records on them? Or what would be the correct SQL to access that table? I'm pretty much lost here :(
I use Codeigniter 2.x and Mysql.
Thanks guys, I will be infinetely grateful for your help.
Two guesses:
a data dictionary provides information about tables in a database:
field names, field types, field sizes
stored procedures associated with certain tables
OR
simply a fixed table that provides lookup or validation for a separate updatable table.
currently Im working on a project that, at first glance, will require many tables in a database. Most of the tables are fairly straightforward however I do have an issue. One of the tables will be a list of members for the website, things like username, password, contact info, bio, education, etc will be included. This is a simple design, however, there is also a need for each member to have their availability entered and store in the database as well. Availability is defined as a date and time range. Like available on 4/5/2011 from 1pm to 6pm EST, or NOT available every friday after 8pm EST. For a single user, this could be a table on its own, but for many users, Im not sure how to go about organizing the data in a manageable fashion. First thought would be to have code to create a table for each user, but that could mean alot of tables in the database in addition to the few I have for other site functions. Logically i could use the username appended to Avail_ or something for the table name ie: Avail_UserBob and then query that as needed. But im curious if anyone can think of a better option than having the potential of hundreds of tables in a single database.
edit
So general agreement would be to have a table for members, unique key being ID for instance. Then have a second table for availability (date, start time, end time, boolean for available or not, and id of member this applies to). Django might sound nice and work well, but i dont have the time to spend learning another framework while working on this project. The 2 table method seems plausable but Im worried about the extra coding required for features that will utilize the availability times to A) build a calender like page to add, edit, or remove entered values, and B) match availabilities with entries from another table that lists games. While I might have more coding, I can live with that as long as the database is sound, functional, and not so messy. Thanks for the input guys.
Not to sound like a troll, but you should take a look into using a web framework to build most of this for you. I'd suggest taking a look at Django. With it you can define the type of fields you wish to store (and how they relate) and Django builds all the SQL statements to make it so. You get a nice admin interface for free so staff can login and add/edit/etc.
You also don't have to worry about building the login/auth/change password, etc. forms. all that session stuff is taken care of by Django. You get to focus on what makes your project/app unique.
And it allow you to build your project really, really fast.
djangoproject.org
I don't have any other framework suggestions that meet your needs. I do... but I think Django will fit the bill.
Create a table to store users. Use its primary key as foreign key in other tables.
The databases are written to hold many many rows in a table. There are not optimized for table creation. So it is not a good idea to create a new table for each user. Instead give each user an unique identifier and put the availability in a separate table. Provide an additional flag to make an entry valid or invalid.
Create a table of users; then create a table of availabilities per user. Don't try to cram availabilities into the user table: that will guarantee giant grief for you later on; and you'll find you have to create an availabilities table then.
Google database normalization to get an idea why.
Take it as truth from one who has suffered such self-inflicted grief :-)
I'm in middle of creating a social networking site something like facebook, and got struck up with database schema design for it.. from previous questions i posted here, i confirmed that i cant create new database or tables for a new user who registers onto my site. I need to insert new row [thats my only option(correct me if i'm wrong!)]. but, this works out for registration for the first time. what if the user posts something new on his profile.. where should i insert this update.. coz, i cant insert them into rows as dey correspond to each user.. and too many columns cannot be created.. what is the solution for this.?
schema =>
TableName : User_content
userId Name College City Status_Updates Messages
1 a sfd fds fsds sdds
2 f dfg dfd fdf dfd
what if user 1 updates something.. what i need to do nw. Think its a status update, how to go about it.?
Before you start thinking about this social network site you dream if
Developing you need to understand database modelling fundamentals. This link will help you with some simple concepts. http://www.databaseanswers.org/tutorial4_data_modelling/index.htm
Add tables based on what you want to allow your users to do and the related data you need to store as a result. Some example tables:
'user_account': User account information (e-mail address, password) - referenced by user ID
'user_profile': Basic user profile information - referenced by user ID
'user_status': User status message - referenced by user ID
I have the sense that this is your first major database application, and if so, you need to learn more about database design in general before you take on creating an application like this. There are many things to consider when designing a database schema and designing it well from the start is key. The core of your application will rely on how well your data is organized and accessible, so ensure you spend enough time developing a good design.
Good luck!