Article describes algorithm of random row selection based on weight, so some rows will be selected more often than other. Article includes sample codes, so I hope will bу helpful to somebody.
Do not hesitate to leave comments if you have ideas how to improve the algorithm.
I should confess - I am already using MySQL prepared statements for some time, but very rarely and mainly because they can make certain scripts more readable. As many of us I have read a lot of articles about coolness of prepared statements and that I should use them because of security and speed improvements. Finally my сuriosity won and I decided to test prepared statements against ordinary SQL statements myself. Friendly speaking I was impressed by the results I got….
A few days ago I have looked through the changes that were applied to PHP in its last release of PHP 5.4 and was impressed by them. I think that small version number change brought the changes that could be compared to the ones that added real OOP to PHP language. So, I decided to review briefly some of them. Hope somebody will find this article interesting….
Article describes how to implement geo coding with Google Maps API v3 from the PHP script. Example of PHP class is published also. Sometimes it is enough and even better to do geo coding server side and store results to the database. This particular situation is described in this article.