ccrevcypsys Posted November 8, 2007 Share Posted November 8, 2007 I am trying to make a new thing on my site where people can add favorite links. Is this a good way to set up the tables? ---customer--- ---yourLinks--- ---yourLink_txt--- customer_id ---+ link_id ---+--- link_id +--- customer_id text1 link1 text2 link2 text3 link3 text4 link4 text5 link5 text6 link6 but i also want to add shortcut images and how many times you click through the link. Can somone help me reform the table to be able to do that? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 8, 2007 Share Posted November 8, 2007 Not that way make the table LinkID (auto Increment P-key) UserID (From your users table) Link (VarChar 128 absolute link) Then when you want to retrive a users links says select Link from `Table` Where UserID = '".$userid."'"; Much easier, its just a big old list of stuff Quote Link to comment Share on other sites More sharing options...
ccrevcypsys Posted November 8, 2007 Author Share Posted November 8, 2007 so only one table then i only want them to be able to have 6 quick links. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 8, 2007 Share Posted November 8, 2007 well you have a users table and a links table so 2 tables, but you can just run a test saying count(*) from `links` where Userid = '".$userid."'"; and if the count is <= 5 add, otherwise alert, or if you don't expect to expand make a single row in a table what ever floats your boat Quote Link to comment 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.