title: How to show members with block = 1 first only if p.user is the page creator?
body: <p>I have a page and this page has a owner.</p>
  
  <p>I'd like to select members of this page.</p>
  
  <p>The problem is, <strong>if</strong> it is the page owner who is logged in (how created the page) I'd like to <strong>show first</strong> (<strong>and only for him</strong>) the members with block = 1 for join autorization.</p>
  
  <p>So I have:</p>
  
  <pre><code>CREATE TABLE `page` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `user` INT(11) UNSIGNED NOT NULL, // who created the page.
    `title` varchar(40),
    `privado` tinyint(1) NOT NULL DEFAULT '0',
  )
  </code></pre>
  
  <p>and page_members (who join the page):</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `page_members` (
    `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `user` INT(11) UNSIGNED NOT NULL, // who is joining
    `member` INT(11) UNSIGNED NOT NULL, // page id
    `block` tinyint(1) NOT NULL DEFAULT '0', // block 1 = need autorization
    FOREIGN KEY (`member`) REFERENCES page (`id`)
  )
  </code></pre>
  
  <p>Suppose I have a page that user 1 created, and it has members.
  I'd like to select <strong>first</strong> the members with <strong>block = 1 if who is logged in is the page owner</strong> (page table, user). if it is not the page owner, I'd like to select only members with block = 0.</p>
  
  <p>So I tried:</p>
  
  <pre><code>select p.user, p.title, pm.user, pm.block from page_members pm
  left join page p on pm.member = p.id
  where pm.member = 100 // show members from page 100
  </code></pre>
  
  <p>.</p>
  
  <pre><code>    and p.user = 1 // from here I'm not sure what to do, 
  I'd like to select and show first the members with block = 1 
  but only if p.user = 1 (the page owner).
  </code></pre>
  
  <p>If p.user = 2, for example, he is not the page owner, so don't show members with block 1, only block 0.</p>
  
  <p>any ideas?</p>