ambo Posted September 30, 2008 Share Posted September 30, 2008 Hey everyone i have a question i have a existing login script with user profile page and what not but i want a friends script so then can add eachother as a friend then view profile any ideas Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/ Share on other sites More sharing options...
DarkWater Posted September 30, 2008 Share Posted September 30, 2008 Yeah, learn PHP and write a new user management system for yourself because most pre-fab scripts from bad tutorials don't work well and can hardly be extended. </rant> Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653559 Share on other sites More sharing options...
ambo Posted September 30, 2008 Author Share Posted September 30, 2008 not very insightful Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653565 Share on other sites More sharing options...
ambo Posted September 30, 2008 Author Share Posted September 30, 2008 I was wondering how i should struture the database would i add a friends variable to my users table or create a freiends table Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653567 Share on other sites More sharing options...
DarkWater Posted September 30, 2008 Share Posted September 30, 2008 not very insightful Do you know PHP, because no one here wants to write this script for you...I mean, people on this forum are here to help, not do it for you. And I was serious. You should learn PHP, and write one yourself. In the amount of time it would take to mash together a solution that probably would break easily, you could have started writing your own login system. Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653568 Share on other sites More sharing options...
ambo Posted September 30, 2008 Author Share Posted September 30, 2008 and if your going to rant you have to have a open tag <rant> Yeah, learn PHP and write a new user management system for yourself because most pre-fab scripts from bad tutorials don't work well and can hardly be extended. </rant> Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653569 Share on other sites More sharing options...
DarkWater Posted September 30, 2008 Share Posted September 30, 2008 You'd have a friends table with one-to-many relationships with each userid. E.x: CREATE TABLE friends ( id INT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, f_id id INT NOT NULL accepted INT NOT NULL ); Then, you'd need to do joins on it to get back your friend data: SELECT u.* FROM friends AS f INNER JOIN users AS u ON f.friend_id = u.user_id WHERE f.user_id = '1' AND f.accepted='1'; Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653570 Share on other sites More sharing options...
ambo Posted September 30, 2008 Author Share Posted September 30, 2008 I have the login system i made the profile and edit profile i was asking a question i didnt need a chat about how i should learn php i didnt ask you to write it for me i said ideas like some insight as to how i should tackle it why i posted again I was wondering how i should struture the database would i add a friends variable to my users table or create a freiends table Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653571 Share on other sites More sharing options...
ambo Posted September 30, 2008 Author Share Posted September 30, 2008 thank you Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653572 Share on other sites More sharing options...
DarkWater Posted September 30, 2008 Share Posted September 30, 2008 I have the login system i made the profile and edit profile i was asking a question i didnt need a chat about how i should learn php i didnt ask you to write it for me i said ideas like some insight as to how i should tackle it why i posted again I was wondering how i should struture the database would i add a friends variable to my users table or create a freiends table Well, you SHOULD learn PHP before coding PHP. I'm pretty sure C programmers don't learn C after writing 10 programs. >_< Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653573 Share on other sites More sharing options...
ambo Posted September 30, 2008 Author Share Posted September 30, 2008 we all start some where MR. PHPGOD i learn more by doing and figuring out then reading and forgetting Link to comment https://forums.phpfreaks.com/topic/126386-new-script-help/#findComment-653593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.