Jump to content

I'm trying something


geus

Recommended Posts

I have one table with users and for each user a table with a list of 8 names.

 

Is there a possibility to make a select from - and then an array or something to call all tables with the names in the users table

 

Or am I trying something that isn\'t possible ?

Link to comment
Share on other sites

Not exactly.

 

I want to collect data from other tables with the names of the users in my users table.

 

But I don\'t want to adjust the script each time a user is added so is it possible that it calls all tables with the names of the users in the user table.

Link to comment
Share on other sites

I have one table with users and for each user a table with a list of 8 names.

 

Is there a possibility to make a select from - and then an array or something to call all tables with the names in the users table

 

Or am I trying something that isn\'t possible ?

 

Basically this is not the best design.

 

Make two tables:

 

1. Having the usernames called users

2. Having the 8 names and the username

 

Like

 

A:

Billy

Bob

Thornton

 

B:

Billy Donald

Billy Duck

Billy Palle

Bob Bush

Bob Sadam

and so on...

 

To get Billys friends...

 

select * from a left outer join b on a.user = b.user where a.user=\'Billy\';

 

P.

Link to comment
Share on other sites

No it\'s something else.

 

I have one table wit users and their data.

 

Then I have for each user a table where they can store data for their own.

 

so

table users

user1

user2

user3

 

and then i have tables called user1, user2, user3

 

I want to collect all data for example

select * from user1

select * from user2

and so on

Link to comment
Share on other sites

Ok, but if the design of table user1 and user2 and so on are identical, i.e. same number of coloumns, format etc. then it\'s a lot better to make one big table to hold this information.

Then just make a single coloumn identifying the \"owner\" of the current row (the username).

 

Otherwise you could quickly end up having a lot of tables, and you would need to allow create table permissions to your scripts.

 

P.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.