clankill3r Posted June 4, 2011 Share Posted June 4, 2011 Hi, how can i create a nested structure with php myadmin, like on the attached image. mysql info: # Server version: 5.1.31-community [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/238381-nested-mysql-structure/ Share on other sites More sharing options...
DaiLaughing Posted June 4, 2011 Share Posted June 4, 2011 I can't tell what you are trying to nest. Tables? Fields? What is in them? Quote Link to comment https://forums.phpfreaks.com/topic/238381-nested-mysql-structure/#findComment-1225070 Share on other sites More sharing options...
clankill3r Posted June 4, 2011 Author Share Posted June 4, 2011 instand of something like this: (where tweedekamer is the database and the rest are tables) tweedekamer -representitives -user1 -user2 -user3 -user4 I want it like this: tweedekamer -representitives -tweets -user1 -user2 -user3 -user4 so the users are in tweets. don't know how else to explain, the tables itself are not the problem, just creating a nested structure. Quote Link to comment https://forums.phpfreaks.com/topic/238381-nested-mysql-structure/#findComment-1225076 Share on other sites More sharing options...
DaiLaughing Posted June 4, 2011 Share Posted June 4, 2011 You can't have tables inside tables if that is what you mean. You can use related tables so that every one tweet (?) has one or many users related to it. Is that what you want? Quote Link to comment https://forums.phpfreaks.com/topic/238381-nested-mysql-structure/#findComment-1225081 Share on other sites More sharing options...
max_w1 Posted June 4, 2011 Share Posted June 4, 2011 Have a look at this article about Nested Set Modelling, i am sure that it will give you a better idea of what you are trying to do. http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Quote Link to comment https://forums.phpfreaks.com/topic/238381-nested-mysql-structure/#findComment-1225172 Share on other sites More sharing options...
clankill3r Posted June 4, 2011 Author Share Posted June 4, 2011 damnit what a big threat anyway for people who strand here name one table something and the other something_something_else and it will end up in: something something _something_else Quote Link to comment https://forums.phpfreaks.com/topic/238381-nested-mysql-structure/#findComment-1225226 Share on other sites More sharing options...
DaiLaughing Posted June 5, 2011 Share Posted June 5, 2011 I can only echo ck's comment on that linked page as a whole but the first chunk - on The Adjacency List Model - would seem to be enough of an answer for most people. I have bookmarked the page for later consideration of the nested part (when masochism strikes) so thanks for the link max. Quote Link to comment https://forums.phpfreaks.com/topic/238381-nested-mysql-structure/#findComment-1225382 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.