Categories
Coding and Logic

When comparing two arrays (in PHP), what is the difference between == and === ?

Wish happy independence day to all Indians.

I have not posted anything since a long time. I thought to break the silence with this small post.

I was appearing for a skill test in Advanced PHP. I scored 82% (though I was expecting to get 90%), but I am upset as the percentile is just 72%. During the skill test, I found many tricky questions. But I am discussing about this particular thing, as I did not found anyone discussing this on the Internet.

Categories
Coding and Logic

Importing MySQL Database in Mac Terminal

Few days back I have posted “How to Dump MySQL Database to a file on Windows”. Exporting large database in phpMyAdmin is not much difficult (however the “command line” method is better), but importing large database in phpMyAdmin is a real headache. First you need to allow to upload a large file. For this you need to change your php settings (you need to modify php.ini file). Your application may not need to upload such large files, but you need to modify this for uploading large database dump file. Then it’ll take a bit long time to upload the huge database file. Then when phpMyAdmin will execute huge number of lines SQL, crossing the maximum execution time and again starting from the point, whether it just crossed maximum execution time. During this process, if you encounter any other problem, then you will have a bigger headache. So you should always prefer importing large MySQL database using command line, i.e. Terminal in Mac. You will find many resources on web discussing about how to Import MySQL Database in linux. But you will find very less resource on Importing MySQL Database in Mac Terminal. So, I decided to write about this here.

Categories
Coding and Logic

Dump MySQL Database to a file on Windows

Most of the people out there are talking about dumping MySQL Database to a file on Linux servers. Many of you must be using MySQL on Windows, with WAMP. However, most of the PHP and MySQL powered websites and applications are hosted on a Linux server, most of the developers must be using WAMP on Windows, as their local development platform. What if you added a new developer to the development team and you all are using your own computer as your local development environment, how will you provide the current MySQL database to the new developer. There is a great chance that you must be using phpMyAdmin. Using phpMyAdmin, you can export your database and save (download) it as a SQL file with zero compression or compressing as zipped or gzipped. But what if you have a large database (in my case, it’s around 100 MB, that means, lots of data)?

Categories
Coding and Logic

Create a price tag using CSS

Before I write anything, I should tell you that I am not a CSS and HTML expert. But I love good CSS and HTML and hate IE and “table for everything” concept. Today morning I started with two small web applications, CSS Border Radius Generator and CSS3 Generator. I knew (and used) about this property before, and also I started falling in love with CSS border radius at the first sight. And I don’t know why, but I used to think that I can create a Price Tag like structure with it. When I saw these two websites today morning, I thought to explore the beauty of CSS Border Radius.

Categories
Coding and Logic

Numbers Logic Challenge

I got awesome response to the previous MySQL Challenge. Awesome means, I got 6 responses, out of which 5 are correct (working) solutions and 2 are optimized solutions. You must be thinking, just 6 responses, but I am saying awesome. Yes, in my opinion quality is what matters, not quantity. I will explain the solution to that MySQL challenge in few more days. Before that, I am back with another small problem. This problem deals with numbers and simple mathematical calculations like addition.