Jam87 Posted December 10, 2007 Share Posted December 10, 2007 Hi all, I'm pretty new, relatively speaking, to php and mysql and have been trying for several days now to create a mysql table for every user upon visiting a certain page. In the past i've used flatfiles so its been pretty easy to define a file with the user_id php session variable. But now i need a similar system for mysql and dont have a clue where or what to replace the variable with. I've looked all over the web and cant seem to find any reference to creating a mysql table for each user, being named after their unique userId. I hope i've explained this well enough, and it makes some sense Thanks in advance to anyone who helps Jam87 Quote Link to comment https://forums.phpfreaks.com/topic/80993-solved-mysql-with-userid/ Share on other sites More sharing options...
Jam87 Posted December 10, 2007 Author Share Posted December 10, 2007 Ok, quick update, i've managed to get the databases created properly using my sites unique user Id variable, all i need to do now is read from those defined tables. the session variable is $userId the connect code is: $conf['dbtable_ab'] = '$userId_book'; $conf['dbtable_cat'] = '$userId_cat'; $conf['dbtable_catmap'] = '$userId_catmap'; the above doesnt work, but i'm sure its down to my bad coding rather than limitation thanks again Quote Link to comment https://forums.phpfreaks.com/topic/80993-solved-mysql-with-userid/#findComment-410893 Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 to create a mysql table for every user upon visiting a certain page. Why on earth would you want a separate database for each user? You might want to find yourself some tutorials on database design. There is a link in my signiture to a free book, within that book is an entire section on working with databases in php. it might get you started. Especially the section on normalization. Quote Link to comment https://forums.phpfreaks.com/topic/80993-solved-mysql-with-userid/#findComment-410930 Share on other sites More sharing options...
fenway Posted December 10, 2007 Share Posted December 10, 2007 Especially the section on normalization. There's a sticky, too. Quote Link to comment https://forums.phpfreaks.com/topic/80993-solved-mysql-with-userid/#findComment-411100 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.