Jump to content

bradh

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by bradh

  1. Ha ha no problem jack. Let me try explain this. What you are trying to do is called a 'one-to-many` relationship in relational database design. This means that one user (one entry) in the user table can have multiple accounts (multiple rows) in the twitteraccounts table. SO: Everytime a user adds a twitter account, it will add a new row to the twitteraccounts table. So your first account in the twitteraccounts table will look like this: id: 1 userid: 1 account_no:1 username: testuser password: &^(#*@&( date_added: 29-06-2009 16:06 and the second account added will look like this: id: 2 userid: 1 account_no:2 username: testuser2 password: &^(#*@&(#@#@# date_added: 29-06-2009 16:10 So BOTH of these accounts will have a userid of 1 and will belong to the user who has that id. This is called the foreign key, and is basically how these two tables relate to each other. so user.id relates to twitteraccounts.userid. I hope this makes some sense to you
  2. Hi Jack, What would happen is, whenever a user creates a new twitter account, it would store the data in the twitteraccounts table, with the userid being the id linked to the specific user the accounts belong to. So what you would do to extract the information from both tables which belong to one user, is use a join. So you could have a query like this: SELECT user.*, twitteraccounts.* FROM user INNER JOIN twitteraccounts ON twitteraccounts.userid = user.id WHERE user.id = 1 This would get all of the information from both tables, where the userid is equal to 1. Hope this helps to illustrate the table relationships. Brad
  3. Thanks, that would indeed solve all my problems Thought about using $_SERVER['HTTP_HOST'] and set up a conditional, but don't think it gets the www part of the URL.
  4. Hi guys, I'm working on a site, let's call it abc. The problem I'm having is when I navigate to http://www.abc.com/ the site works perfectly. All the select lists are populated via ajax, scripts are all loading and executing correctly. BUT When I navigate to http://abc.com/ the site still shows, but all the javascript stuff isn't working as it should. The lists aren't populated etc. Is there a way I can redirect all pages calling http://abc.com/etc.. to http://www.abc.com/etc..? I haven't found a solution to it yet. Thanks
×
×
  • 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.