<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1038928" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1038928</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1222201</link>
    <description> &lt;p&gt;Here&#039;s what I would suggest, although I&#039;m still not completely sure how to do it:&lt;/p&gt;
&lt;p&gt;The users table looks like this:&lt;/p&gt;
&lt;p&gt;UserId, Username, Name, Email, Location, CurrentFriends, PendingRequests&lt;/p&gt;
&lt;p&gt;Obviously those names can be different, but just so you know what each is for.&lt;/p&gt;
&lt;p&gt;Here&#039;s what one row might look like:&lt;/p&gt;
&lt;p&gt;321&lt;br /&gt;
mscreashuns&lt;br /&gt;
Andrew&lt;br /&gt;
&lt;a href=&quot;mailto:name@domain.com&quot; class=&quot;bb-email&quot;&gt;name@domain.com&lt;/a&gt;&lt;br /&gt;
USA&lt;br /&gt;
(friendID1,friendID2,friendID3,friendID4...)&lt;br /&gt;
(pendingFriendID1,pendingFriendID2...)&lt;/p&gt;
&lt;p&gt;Then each value in the PendingRequests and CurrentFriends columns could be separated starting at the commas and ending at commas (Like I said, I&#039;m still working on exactly how you could go about this.  I have several ideas in mind).  By the userID, the usernames would each be listed as a link saying &#039;Add USERNAME as a friend.&#039; and when you click that, it removes that userID from the PendingRequests and adds it to the CurrentFriends.&lt;/p&gt;
 </description>
     <pubDate>Thu, 26 Jul 2007 12:30:02 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1222201 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1222193</link>
    <description> &lt;p&gt;What fields would you use for the friends and pending table? Would I have the following in the friends table?&lt;/p&gt;
&lt;p&gt;UserId, FriendsWith, Pending&lt;/p&gt;
&lt;p&gt;The FriendsWith Column is the user who sent the friend request, and before they are approved &#039;Y&#039; is put into the pending column.&lt;/p&gt;
&lt;p&gt;If I had a friends table rather than a friends table for each user (which would take up alot of space) would the data look something like this:&lt;/p&gt;
&lt;p&gt;UserId, FreindsWith, Pending&lt;br /&gt;
user1     user4&lt;br /&gt;
user1     user2&lt;br /&gt;
user1     user11            Y&lt;/p&gt;
&lt;p&gt;User1 has 3 friends, but there are three records, is this why you suggested using the array in the users table?&lt;/p&gt;
 </description>
     <pubDate>Thu, 26 Jul 2007 09:11:30 +0000</pubDate>
 <dc:creator>drew22299</dc:creator>
 <guid isPermaLink="false">comment 1222193 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1222141</link>
    <description> &lt;p&gt;I&#039;m not sure what the FriendsWith column means in the Pending Friends Request Table, but here&#039;s how you could put it into one table:&lt;/p&gt;
&lt;p&gt;UserId, FriendsWith, Pending&lt;/p&gt;
&lt;p&gt;and if someone happens to stumble upon this thread who can tell you how to use MySQL and arrays that would be great, but I&#039;ll do a little research today and see what I can figure out.&lt;/p&gt;
 </description>
     <pubDate>Wed, 25 Jul 2007 12:37:00 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1222141 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1222139</link>
    <description> &lt;p&gt;If I have a pending and friend coloumn wouldn&#039;t that mean I could only have one pending friend request at any given time? Because wouldn&#039;t new friend requests just overwright an existing pending friend request? I&#039;m thinking I will need to have separate tables for now, and maybe change it later if needed as you suggested using an array to store friends.&lt;/p&gt;
&lt;p&gt;I am going to create these tables now and intergrate the messages and friend requests into my website, please can you help with the tables? &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/confused.png&quot; title=&quot;Confused&quot; alt=&quot;Confused&quot; class=&quot;smiley-content&quot; /&gt; &lt;/p&gt;
&lt;p&gt;So, assuming I already have a&lt;strong&gt; users table &lt;/strong&gt;with the following fields: UserId, Username, Name, Email, Location, (any additional fields you think would be needed please let me know)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Messages Table&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I&#039;m not sure on how to impletemnt the website to allow messages to be sent between users but here are the fields I think I need (does this look right to you?)&lt;/p&gt;
&lt;p&gt;MessageId, Message, DateSent, UserFrom, UserTo&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Friends Request Table&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For this I am going to put a link on the users profile to allow them to send a friend request to that user. Would I need a pending table and a friends table for this? Or could it be done in just one table?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pending Friends Request Table&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;UserId, FriendsWith, Pending,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Friends Table&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;UserId, FriendsWith&lt;/p&gt;
 </description>
     <pubDate>Wed, 25 Jul 2007 10:30:04 +0000</pubDate>
 <dc:creator>drew22299</dc:creator>
 <guid isPermaLink="false">comment 1222139 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1221493</link>
    <description> &lt;p&gt;Yes, although it doesn&#039;t have to be a table, you do realize?  It can be just another column in the table, each friend separated by a comma.  Then, once approved, the corresponding request would be deleted from the pending column and added to the friend column.&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Jul 2007 16:07:06 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1221493 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1221491</link>
    <description> &lt;p&gt;Thanks! I have just thought that if people are to request to be friends there is going to need to be a pending friend request table?&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Jul 2007 15:15:04 +0000</pubDate>
 <dc:creator>drew22299</dc:creator>
 <guid isPermaLink="false">comment 1221491 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1221489</link>
    <description> &lt;p&gt;I assume by friends you mean like a buddies list, and with this there are a few ways you could do this.  You could either create a new table for each user called something like &#039;userName_friends&#039;, which obviously would result in a lot more data and would slow down your system most likely.  Another method would probably be to add another column to your table and set it as a &lt;strong&gt;SET&lt;/strong&gt; (as opposed to &lt;strong&gt;VARCHAR&lt;/strong&gt;, &lt;strong&gt;INT&lt;/strong&gt;, etc).  You could separate each friend with a comma and then use JavaScript or possibly PHP (I can&#039;t remember right at this moment how to do it) to strip the commas and store each friend separately in an array.  I&#039;ll get back with you if I think about it, unless someone else does first.  &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Jul 2007 13:41:07 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1221489 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1221481</link>
    <description> &lt;p&gt;What about if I want a freinds table? What columns would I have? Would it work the same as the messages table?&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Jul 2007 10:45:47 +0000</pubDate>
 <dc:creator>drew22299</dc:creator>
 <guid isPermaLink="false">comment 1221481 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1221407</link>
    <description> &lt;p&gt;No, they do not really need any connection.  The users table, generally, presents an environment for profile information and it gets us a userID.  Then, the messages table handles all the messages, using the userIDs as the to and from fields, which you would certainly want to present as usernames in the messages.&lt;/p&gt;
 </description>
     <pubDate>Mon, 09 Jul 2007 16:46:18 +0000</pubDate>
 <dc:creator>mscreashuns</dc:creator>
 <guid isPermaLink="false">comment 1221407 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/what-tables-do-i-need#comment-1221402</link>
    <description> &lt;p&gt;Thats a really good way of doing it! Thanks &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt; But would I need a message ID column in the users table? Does the user table need to know about the message table?&lt;/p&gt;
 </description>
     <pubDate>Mon, 09 Jul 2007 15:05:35 +0000</pubDate>
 <dc:creator>drew22299</dc:creator>
 <guid isPermaLink="false">comment 1221402 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
