ziedinjsh Posted November 3, 2012 Report Share Posted November 3, 2012 Čau atkal! Ir kopējais lietotāju saraksts kurā ir izņemts profils kurš ir ielogojies. ir block tabula kurā ir bloķētāja lietotāja ID un nobloķētā ID kā lai uztaisa lai nerādās saraksta, ko redzu es, bloķētie lietotāji?? Quote Link to comment Share on other sites More sharing options...
briedis Posted November 3, 2012 Report Share Posted November 3, 2012 Ar apakšvaicājumu SELECT * FROM users WHERE id NOT IN (SELECT id FROM blocked_users) Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted November 3, 2012 Author Report Share Posted November 3, 2012 Paldies, izdevās :) Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 5, 2012 Report Share Posted November 5, 2012 Otrs, un performancei draudzīgājs risinājums, būtu «users» tabulai pievienot kolonu «blocked». ~~~ SELECT * FROM `users` WHERE `blocked` = 0; UPDATE `users` SET `blocked` = 1 WHERE `id` = 1; UPDATE `users` SET `blocked` = 1 WHERE `id` IN (1, 2, 3); ~~~ 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.