nathanmaxsonadil Posted August 30, 2007 Share Posted August 30, 2007 I have a site with lots of lists and I need to list them by the users table I was wondering if it is good practice to have a field in the users table for each list and then say like yes if on and no if not? Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/ Share on other sites More sharing options...
akitchin Posted August 30, 2007 Share Posted August 30, 2007 what do you mean by lists? do you mean a series of options that are either yes or no? if you have a boolean field (either on or off, equivalent to yes or no), use a BOOLEAN field type and enter either 0 or 1. Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-337881 Share on other sites More sharing options...
nathanmaxsonadil Posted August 30, 2007 Author Share Posted August 30, 2007 I mean like I have 1 users table that has username email password points... I have sevral username lists that need to be listed by points in the users tableI was wondering if I should do like SELECT * FROM users WHERE list1='true' ORDER BY points... Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-337895 Share on other sites More sharing options...
fenway Posted August 30, 2007 Share Posted August 30, 2007 I mean like I have 1 users table that has username email password points... I have sevral username lists that need to be listed by points in the users tableI was wondering if I should do like SELECT * FROM users WHERE list1='true' ORDER BY points... No, you should have a table of lists & points. Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-338018 Share on other sites More sharing options...
nathanmaxsonadil Posted August 30, 2007 Author Share Posted August 30, 2007 the points get updated quite frequently so I would have to go through sevral table's Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-338055 Share on other sites More sharing options...
fenway Posted August 31, 2007 Share Posted August 31, 2007 Serveral? You mean one. Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-338182 Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 I have like 23 lists Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-338193 Share on other sites More sharing options...
fenway Posted August 31, 2007 Share Posted August 31, 2007 So, you have 23 records per user. Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-338241 Share on other sites More sharing options...
AndyB Posted August 31, 2007 Share Posted August 31, 2007 Now would be a really good time to restate your problem coherently with contextual examples. Maybe you know what you're trying to do, but I suspect others are slightly baffled. Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-338243 Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 ah i fixed it going over the sql tutorial on w3cschools a few times Link to comment https://forums.phpfreaks.com/topic/67350-solved-good-practice-to-have-lots-of-fields/#findComment-338309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.