title: Mysql Select record where PRIMARY key = x
body: <p>I have a primary key in my mysql table which is comprised of three columns. </p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `bb_bulletin` (
    `OfficeCode` int(5) NOT NULL,
    `IssuerId` int(11) NOT NULL,
    `BulletinDtm` datetime NOT NULL,
    `CategoryCode` varchar(4) NOT NULL,
    `Title` varchar(255) NOT NULL,
    `Content` text NOT NULL,
    PRIMARY KEY (`OfficeCode`,`IssuerId`,`BulletinDtm`),
    UNIQUE KEY `U_IssuerId` (`IssuerId`,`OfficeCode`,`BulletinDtm`),
    UNIQUE KEY `U_CategoryCode` (`CategoryCode`,`OfficeCode`,`IssuerId`,`BulletinDtm`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p>Is there a shorthand method to select a record for a given value of the primary key. </p>
  
  <p>I tried. </p>
  
  <pre><code>SELECT * FROM `bb_bulletin` WHERE PRIMARY = '20001-1-2011-01-07 14:04:40'
  </code></pre>
  
  <p>Instead of the long hand method of doing, </p>
  
  <pre><code>SELECT * From bb_bulletin WHERE OfficeCode = 20001 AND IssuerId = 1 AND BulletinDtm = 2011-01-07 14:04:40
  </code></pre>
  
  <p>What is the standard when dealing php and composite keys in your table. 
  Note: I don't want to add autoincrementing keys to my tables in order to solve this. If it is not possible then I will just pass the three constraints in my url. </p>