Skip to main content

Posts

Showing posts from September, 2010

Duplicate entry 127 for key 1

Last night I was coding, I got this error "#1062 - Duplicate entry '127' for key 1 ". (I was writing PHP code and MySQL). Basically I couldn't add any entry to the table in the database, after 2 hours checking line by line the code which I have written, still same error. I sat back and tried to calm down because I was panic, I left the code and concentrated on the error message, "Duplicate", "entry", "127", "key 1". I knew the word in the error message except "127", what is for? Why is here? In the table in the database, the primary key 1 was TINYINT. As soon as I searched in Google, I found that a TINYINT filed can take up to 128 values which in this case already been taken, so the capacity is full. Easily I figure out that the primary key 1 should change to INT, and that’s worked. I wish someone was here to see my face while I was trying to solve this issue and after been solved.

Knowledge

There is only one good, knowledge, and one evil, ignorance Socrates.(469 BC - 399 BC)
The beautiful thing about learning is nobody can take it away from you. B.B.King(1997)
The beginning of knowledge is the discovery of something we do not understand. Frank Herbert (1920 - 1986)
knowldge is power Francis Bacon(1592)>
A man who knows how little he knows is well, a man who knows how much he knows is sick. Witter Bynner(1944)
Integrity without knowledge is weak and useless, and knowledge without integrity is dangerous and dreadful. Samuel Johnson
A little learning is a dangerous thing Alexander Pope

How to prevent automatic submission by spammers?

I guess all who read this post, probably seen spam email or if you have blog, you’ve seen a lot of spam comment on your posts. Spam are not something new, nowadays they are becoming a bigger problem for the Internet. Popular websites, like YouTube, Wordpress, blogger which users can comment are protected by advanced spam blocker, but how about a small website like mine. As I wrote the code for my blog myself, I didn't include any third party codes even for validation or preventing from spam, So I used to receive a lot of spam comments which were so annoying, I had to stop them but how? bear in mind that because first of all, my website is for my educational purpose so I must not copy from elsewhere code for my website, also I wanted to use unique way of doing this, well! It is all about. I came up with an idea which you can see in the photo. Basically I made a disabled text area (user can not click or copy) which has random digit, user should enter that random code in the box …

Math math math

I love math, I remember, back in high school usually I had highest grade in math in the class at the same time lowest grade in geography and history.let's read this article.
A boy of 15 who has never been to school has become the youngest student for more than 200 years to win a place at Cambridge University. Arran Fernandez, who was educated at home by his father, Neil, will start a mathematics degree at Fitzwilliam College next month. It will make him the youngest Cambridge student since 14-year-old William Pitt the Younger studied there in 1773. Last night the child prodigy said: ‘I am looking forward to going to the lectures. ‘I have already started the first-year books and it is all right, not too difficult. ‘I am excited about going to Cambridge but I am used to making records about being the youngest in education.’
On a roll... Arran became the youngest person to get an A in maths GSCE at seven years old 'It isn't the youngest bit that is so important to me - I'm more …