Changeset 319


Ignore:
Timestamp:
03/18/10 03:24:53 (23 months ago)
Author:
antonbatenev.ya.ru
Message:

Исправление ошибок с кодировкой и квотированием в скрипте перегона данных MySQL -> SQLite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/mysql2sqlite/mysql2sqlite.php

    r214 r319  
    3030// 
    3131 
    32 function quoteString ($param) 
    33 { 
    34         return "'" . sqlite_escape_string($param) . "'"; 
    35 } 
    36  
    3732if (file_exists($sqlite_filename) == true) 
    3833        unlink($sqlite_filename) or die ("can't delete file " . $sqlite_filename . "\n"); 
     
    4944} 
    5045 
     46function quoteString ($param) 
     47{ 
     48        global $sqlite_connection; 
     49        return $sqlite_connection->quote($param); 
     50} 
     51 
    5152// 
    5253// создание схемы БД 
     
    6768$mysql_connection = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die ("mysql_connect: " . mysql_error() . "\n"); 
    6869mysql_select_db($mysql_database, $mysql_connection) or die ("mysql_select_db : " . mysql_error($mysql_connection) . "\n"); 
     70mysql_set_charset("utf8", $mysql_connection) or die ("mysql_set_charset : " . mysql_error($mysql_connection) . "\n"); 
    6971 
    7072// 
Note: See TracChangeset for help on using the changeset viewer.