hallo
ich verwende Delhi xe8 und ich moechte griechische charakter in Databank importieren aber wirt immer als ?????? importiert
DELPHI CODE:
function MultiplyTwoNumbers(a,b: string):string;
var
url,key: string;
H: TIdHttp;
SS: TStringStream;
begin
// Prepare the
URL
key:='MEINPASSWORT123';
a := utf8decode(a);
url := 'http://-----------------------/test.php?T1=' + a +'&key='+key;
H := TIdHttp.Create(nil);
try
SS := TStringStream.Create('', TEncoding.UTF8);
try
form1.IdHTTP1.get(
url, SS);
Result := SS.DataString;
finally SS.Free;
end;
finally H.Free;
end;
end;
************************************************** **********************
PHP CODE:
<?php
define("KEY","MEINPASSWORT123");
define('DB_SERVER',"
localhost");
define('DB_NAME',"*************");
define('DB_USER',"*************");
define('DB_PASSWORD',"*************");
$conn = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD);
mysql_select_db(DB_NAME, $conn);
mysql_query("SET NAMES 'utf8'", $conn);
mysql_query("SET CHARACTER SET 'utf8'", $conn);
//include("
db.php");
if(isset($_GET['key']))
{
if($_GET['key'] == KEY)
{
if(isset($_GET['T1']))
{
$T1 = mysql_real_escape_string($_GET['T1']);
$T2 = mysql_real_escape_string($_GET['T2']);
$result = mysql_query("INSERT INTO test(onoma)
VALUES('".$T1."') ") or die(mysql_error());
if(mysql_affected_rows() == 1)
{
$result = "αποθυκευτικε";
} else $result = "Error
MySQL-Datenbank";
} else $result = "Error1";
} else $result = "Error2";
} else $result = "Error3";
print_r($T1);
?>
************************************************** *********************
mit obere functionen werden dir griechiscge zeichen als ????????????? in Datenbank eingetragen?
ich bit um hilfe?
danke