All posts by Gangarasa

MySQL Error: Cannot add or update a child row: a foreign key constraint fails

Ever got an error like the one below?
Cannot add or update a child row: a foreign key constraint fails (`db01`.<result 2 when explaining filename '#sql-651_3'>, CONSTRAINT `table01_batch_id_foreign` FOREIGN KEY (`batch_id`) REFERENCES `the_batches` (`id`))

Then, there must be some rows with a column value (for batch_id) that is non-existent in the master table. In my case the column (in the child table) was set to DEFAULT value of 0 and obviously a matching id was not found in the master table.

MyWestside – Your portal was never updated after 2009?

MyWestside Profile PageDuring my recent visit to WestSide someone at the checkout told me my existing MyWestside membership card had expired and they issued a new card with a charge of Rs. 150. In order to make sure they entered correct info, I logged into and that is when I came across a really old drop down list for year of wedding. It started from 1900 and ended at 2009! @MyWestside, is there a specific reason behind this? If not, please ask someone to update it. I know several people who got married during 2010, 2011, 2012 and even 2014!

Model Code of Conduct – Polls 2014

From the day I renamed this blog as ‘lets_Do_GoodCode’, I’ve been thinking more of non-code stuff to write about than the code. It takes its own efforts/dedication to come back and write about the code you wrote. Thanks to all those doing it which has helped developers like me world-wide.

I cast my vote!Anyways, I just cast my vote. It took nearly 45 minutes to find the right book that had my name. To my surprise, someone had already taken my voter slip! Walked down straight to the polling booth to find a friendly security guard at the door. He confirmed, there are agents inside with a fresh copy of Book #139. Oh btw, I want to thank that gentleman who was helping everyone to find their new part numbers and roll ids online. I was over-confident of the details printed on my voter card which seem to have changed. Thanks to that man. Honestly, it was all available online at various places and one could find their voter details pretty easily, although some really-old ones were removed.

Malkajgiri lok sabha constituency, to which my voter id belonged, had two EVMs of candidates or they were paged across two EVMs! Anyways, I cast my vote and feel happy. Please go out and vote. Do not get hassled with the crowds around polling stations, we’re a billion and you happen to see more and more people.

DocumentRoot is like the open sky. Many times you are not the one watching it thru Hubble!