Category Archives: mysql

mysql string replace

ShareYou can check the mysql function string_replace here http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace Ex: mysql> SELECT REPLACE(‘www.mysql.com‘, ‘w’, ‘Wo’); output:  ‘WoWoWo.mysql.com’ Or you can also do it on UPDATE statements like this UPDATE table SET table_field=REPLACE(table_field, search_string, replace_value_here)  

More Galleries | Leave a comment

How to change charset of database

Share PROBLEM: How to modify or change the database’s charset SOLUTION; charset of dbase – to change this ALTER DATABASE

Posted in mysql | Tagged , , , , | Leave a comment

optimizing mysql database

ShareWhat are Indexes? Indexes are organized versions of specific columns in your tables. MySQL uses indexes to facilitate quick retrieval of records. With indexes, MySQL can jump directly to the records you want. Without any indexes, MySQL has to read … Continue reading

Posted in mysql | Tagged , , | Leave a comment

UNIX_TIMESTAMP

ShareUNIX_TIMESTAMP(), UNIX_TIMESTAMP(date) If called with no argument, returns a Unix timestamp (seconds since ’1970-01-01 00:00:00′ UTC) as an unsigned integer. If UNIX_TIMESTAMP() is called with a date argument, it returns the value of the argument as seconds since ’1970-01-01 00:00:00′ … Continue reading

Posted in mysql | Tagged , , , , | Leave a comment

monetary data: decimal vs. double

ShareThe DECIMAL and NUMERIC data types are used to store exact numeric data values. In MySQL, NUMERIC is implemented as DECIMAL. These types are used to store values for which it is important to preserve exact precision, for example with … Continue reading

Posted in mysql | Tagged , , , , | Leave a comment