NYCPHP Meetup

NYPHP.org

[nycphp-talk] Database, table, and column naming schemes

Dan Cech dcech at phpwerx.net
Tue Oct 6 13:34:22 EDT 2009


Matt Juszczak wrote:
>>> SELECT some_attribute FROM some_rel WHERE user_id=X AND account_id=Y
> 
> Yes, but this can return multiple rows.  What if you only want to return
> one row?  You don't necessarilly *need* a new auto_increment, and in
> fact, it probably isn't necessary, but you should make sure there's an
> inde on (user_id,account_id) :)

That's what the primary key is for ;)

Dan



More information about the talk mailing list