nathanmaxsonadil Posted August 31, 2007 Share Posted August 31, 2007 sorry to bother you again but I'm wondering if this will work SELECT list1.listf1 FROM users, list1 ORDER BY users.points not everyone on my users table is in this list will it still order properly? Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/ Share on other sites More sharing options...
Barand Posted August 31, 2007 Share Posted August 31, 2007 Provided table and column names are correct it will give results, so in that sense, it will work. However, whether it gives the results you want is another thing. If you define what "work" means we can help more. Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338789 Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 not everyone on my users table is in this list will it still order properly? Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338804 Share on other sites More sharing options...
Barand Posted August 31, 2007 Share Posted August 31, 2007 In that case the fact that not all users are there just means that listf1 will not be listed as many time as it would if they were present. Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338814 Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 but it will still order properly? Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338815 Share on other sites More sharing options...
effigy Posted August 31, 2007 Share Posted August 31, 2007 Since you're selecting from two tables, shouldn't you be using a join? Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338818 Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 how would I do that? Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338822 Share on other sites More sharing options...
Barand Posted August 31, 2007 Share Posted August 31, 2007 It will order by the ones that are present. Why don't you try running the query to see if it "works"? @effigy When he actually tries the thing himself and sees it joins every record in list1 with every record in user, then no doubt he'll be back saying "Why doesn't my query work?" Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338823 Share on other sites More sharing options...
Barand Posted August 31, 2007 Share Posted August 31, 2007 how would I do that? If you told us a liitle more, like what you are trying to do and what you have in each table. we could tell you Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338824 Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 it really hard to test my query.... because I have to register test users then add them to the list... I can't have double email's and you need activation for registering... Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338836 Share on other sites More sharing options...
effigy Posted August 31, 2007 Share Posted August 31, 2007 How is "users" connected to "list1," if at all? (foreign keys) Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338838 Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 in the table uses there's a field email Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-338874 Share on other sites More sharing options...
zq29 Posted September 2, 2007 Share Posted September 2, 2007 it really hard to test my query.... because I have to register test users then add them to the list... I can't have double email's and you need activation for registering... Why don't you just add the test data directly to the database, surely that would be a hell of a lot quicker... Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-339744 Share on other sites More sharing options...
Azu Posted September 2, 2007 Share Posted September 2, 2007 it really hard to test my query.... because I have to register test users then add them to the list... I can't have double email's and you need activation for registering...<?mysql_connect(); while(++$a<9999)mysql_query('insert into database.table(name,password,email)values(rand(),rand(),rand()');?> Link to comment https://forums.phpfreaks.com/topic/67475-will-this-work/#findComment-339785 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.