Yesterday, after long period of API testing, new version was submitted gor review, the most important changes:

  • synchronization
  • switched to our own API – currently only for updating data, in next version for all operations

New API is built using Python 3.3 with Flask framework and MySql database

Well, first rule – you should not do this. But if there is good reason, consider using such query for searching in index-based arrays:

SELECT * FROM table WHERE your_field_here REGEXP '.*;s:[0-9]+:"your_value_here".*'

In case you have assoc array serialized you can use:

SELECT * FROM table WHERE your_field_here REGEXP '.*"array_key_here";s:[0-9]+:"your_value_here".*'

Of course it won’t be very fast but in small tables should be enough

Just use:

         RAND() * 
            (UNIX_TIMESTAMP('2012-11-13 16:00:00') - UNIX_TIMESTAMP('2012-11-13 23:00:00')) + 
             UNIX_TIMESTAMP('2012-11-13 23:00:00')
                  ), '%Y-%m-%d %H:%i:%s')

where first param UNIX_TIMESTAMP(‘2012-11-13 16:00:00’) is start value, second UNIX_TIMESTAMP(‘2012-11-13 23:00:00’) is end value, it has to be repeated twice like shown here:

  FROM_UNIXTIME(RAND() * (starttime- endtime) + endtime)
  , '%Y-%m-%d %H:%i:%s')