I am Hack Sparrow
Captain of the Internets.

MySQL Pagination

The secret to paginating MySQL results lies in the LIMIT clause of its SELECT command. We'll learn how to paginate results using PHP and Node.js, in order to understand better we'll work with data from a sample table. Create a new database named learnmysql and run this query on it (we are creating a table named songs and populating it some sample data to work on): [code] CREATE TABLE `songs` ( ...

Using MySQL with Node.js

New to Node.js and wondering if you can use your old friend MySQL with it? Good news - it is surprisingly very easy to get MySQL working with Node.js. This article guides you through the process. First of all, you'll need to install an aptly named Node.js module called . [code] $ npm install mysql [/code] The module is entirely written in Node.js, and implements an async MySQL client. Mad respect to t ...

How to repair a crashed MySQL table

Your website stops working and you see a spine-chilling error message "MySQL table is marked as crashed and should be repaired". What now? Well, you need to repair it. There are two approaches to repairing a crashed table. I hope it is not bad news for you, but they will work only for MyISAM engines. If you are using InnoDB, consider restoring the table from a backup (at the cost of loss of some data). The most common reason ...

Debating about SQL vs. NoSQL, Redis vs. MongoDB vs. CouchDB etc?

Here is a collection of articles to to help you get a better idea about NoSQL and its options. They will also probably answer your Redis vs. MongoDB vs. CouchDB vs. MySQL query. It did for me, the answer is is not that exciting - "use the right tool for the right job" :D What the heck are you actually us ...

MySQL: How to copy a MySQL table

Probably you figured out how to backup and create a copy of your whole database already. But that's not what we wanna do all the time, sometimes you just wanna create a copy of a certain table before you experiment and do stuff on the target table. Before we start copying the whole table, probably there is another requirement you might have. Maybe you don't wanna create a copy of the table with all its contents, maybe you just wanna b ...