Piwik is a Open source web analytics application that has a huge number of valuable functions related to SEO and other analytics stuff built-in. One such module is RankChecker. This module provides page rank information for Google, Dmoz and Alexa. With some modification to the original RankChecker.php we can use it in our own application (with appropriate license). The following is a example code for the same using RankChecker.
WordPress upgrades is a task most users do on a frequent basis,and most of the time it works flawlessly. But once in a while something goes wrong and WordPress doesn’t behave the way we expect. The most common complaint I see is the following error being thrown during wp-admin login after a WordPress database upgrade.
“You do not have sufficient permissions to access this page”
This innocuous message however is the source of many a wasted hours. Although there could be many reasons for the above message, the one I most often see cited is the inconsistency between WordPress prefix for the following values:
As with many other databases, MySQL provide a BLOB type that allows you to store binary data – images, wav files, videos etc. A frequent question developers have is regarding to storing images in the database. There is much discussion and argument with no final say on the issue. In one of my recent project the same issue was raised; the client and myself discussing the benefits and drawback of storing the images into a database. The project needed storing around 50,000 images, so it was important to get the question resolved satisfactorily.
After much deliberation we settled on using the file system. The major factor in the decision was that we needed the database and images decoupled as we would be having multiple databases using the same set of images. Also in the future it was possible that we would require some processing done on the images (cropping, resizing), which would be tedious and taxing if the images where stored in the database. So in light of these factors we found using a filesystem a suitable solution.
Posted in: mysql | February 11, 2013 |
One frequently needs to export some MySQL tables along with certain queries that will work with that table for testing. Usually one only needs a subset of records from the table which will work with the selected queries, rather then the complete table. This can be required when the table contains thousands or millions of records and we do not want to export the complete data set, as this can be time consuming during import, or maybe we only want to provide the other user with some selected records for security reasons.
Say we have a simple WordPress database with a
SELECT statement like the following:
SELECT * FROM wp_posts WHERE post_status = 'draft'
If you want to only export records that will match the corresponding query above, then we can use the ‘mysqldump’ command-line utility with the ‘–where’ option.
The first SQL query most people learn is the SELECT statement with a query some thing like the following.
SELECT * FROM users WHERE id > 100
Nothing wrong with the syntax itself; but more often than not, what the user really wants is just a few columns from the table as shown in the PHP code below. Here we are only using three columns from the table. The usual practice of developers is to use the
* modifier to get all the columns from the table as it is easier then specifying individual column names. It is quicker to select all columns from a table and worry later which to actually use in the code.
This site is a digital habitat of Sameer, a freelance web developer working in PHP & MySQL.More