SELECT * FROM 'table' WHERE `name` REGEXP '\r' UPDATE 'table' SET 'field' = REPLACE(FIELD,"findvalue", "reaplcevalue") WHERE REGEXP 'regexp search expression'
Archive for the ‘MySQL programiranje’ Category
Search and replace within a field with regex in MySQL
Wednesday, February 24th, 2010UTF-8 connect to MySQL database
Monday, February 22nd, 2010
mysql_query("SET NAMES 'utf8' COLLATE 'utf8_slovenian_ci'");
mysql_query("SET CHARACTER SET 'utf8';");
How to change the collation for all tables in a MySQL database to UTF-8?
Monday, February 22nd, 2010
<?php
$db = mysql_connect("localhost", "username", "pass");
if(!$db) echo "Cannot connect to the database - incorrect details";
mysql_select_db('myuser_mydbname'); $result=mysql_query('show tables');
while($tables = mysql_fetch_array($result)) {
foreach ($tables as $key => $value) {
mysql_query("ALTER TABLE $value COLLATE utf8_slovenian_ci");
}}
echo "The collation of your database has been successfully changed!";
?>
MySQL database backup intro terminal
Sunday, January 17th, 2010mysql -u user -p pass databasename < /home/user/dbBackup/backup.sql
mysql_set_charset
Saturday, January 9th, 2010Dodaj kjer se povezuješ z bazo
PRIMER 1
mysql_query(“SET NAMES utf8″);
PRIMER 2$link1 = mysql_connect(‘localhost’,'user1′,’pass1′,TRUE);
mysql_selectdb(‘db1′,$link1);
mysql_set_charset(‘utf8′,$link1);






![Validate my RSS feed [Valid RSS]](wp-content/uploads/valid-rss.png)


