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? Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 but it will still order properly? Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
nathanmaxsonadil Posted August 31, 2007 Author Share Posted August 31, 2007 how would I do that? Quote Link to comment 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?" Quote Link to comment 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 Quote Link to comment 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... Quote Link to comment 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) Quote Link to comment 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 Quote Link to comment 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... Quote Link to comment 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()');?> 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.