Jump to content

I'm trying something


geus

Recommended Posts

loop through the first query\'s results and assemble another query string; then execute that one. i\'m not sure i fully understood what you\'re trying to do... can you use a join? :shock:

 

something like this?

 

http://forums.phpfreaks.com/viewtopic.php?t=1644

Link to comment
https://forums.phpfreaks.com/topic/102-im-trying-something/#findComment-285
Share on other sites

  Quote
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
https://forums.phpfreaks.com/topic/102-im-trying-something/#findComment-304
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
https://forums.phpfreaks.com/topic/102-im-trying-something/#findComment-306
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
https://forums.phpfreaks.com/topic/102-im-trying-something/#findComment-308
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.