mysql two column primary key with auto-increment

if you are using myisam http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html For MyISAM and BDB tables you can specify AUTO_INCREMENT on a secondary column in a multiple-column index. In this case, the generated value for the AUTO_INCREMENT column is calculated as MAX(auto_increment_column) + 1 WHERE prefix=given-prefix. This is useful when you want to put data into ordered groups. CREATE TABLE … Read more

Multiple table joins in rails

To rewrite the SQL query you’ve got in your question, I think it should be like the following (though I’m having a hard time fully visualizing your model relationships, so this is a bit of guesswork): RagaContextApplicantsSong. joins(:raga_contest_applicants => [:raga_content_rounds], :contest_cat). group(‘raga_contest_rounds.contest_cat_id’) …such that the joins method takes care of both of the two joins … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)