Hi.
I have mentioned this problem before in a newsgroup, but the answers did
not help me solve it - So here i go again.
Why doesn't my national (swedish) characters show up correctly?
I get "TM" (as in trademark) instead of "Ö" (capital o with the two
dots) for example.
I have (on recommendation) experimented with the PHP function HTML
ENTITIES but it doesn't seem to make any difference.
Maybe i am using the function wrong?.
Is the problem located elsewhere - like in my imported MSAccess DB,
MySQL or PHP?
Background info:
I run PHP 4.04pl1 and MySQL 3.23.35 on a W98SE with WPS.
I have successfully exported one MS Access database, which i have
imported into MySQL.
I have managed to set up a form which submits a query to the DB and
simply print the result.
Below are my (unfinished) input / search forms. As you can see i have
experimented with the row "Foretag":
<html>
<body>
<form action=SQLsearchform2.php method=GET>
Kundnummer: <input type=text value="" name=kund_nr size=25 maxlength=25>
Postadress: <input type=text value="" name=postadress size=25
maxlength=25>
Företag: <input type=text value="" name=foretag size=25 maxlength=30>
<p>
<input type=submit>
</form>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta name="GENERATOR" content="Anteckningar [sv] (Win98; U)
[Microsoft]">
<title>Söksida</title>
</head>
<body>
<?php
mysql_connect (localhost,"root" , "");
mysql_select_db (MyDB);
if ($kund_nr == "")
{$kund_nr = '%';}
if ($postadress == ""){
$postadress = '%';
} else {
$postadress = '%' . $postadress . '%';
}
if ($foretag == ""){
$foretag = '%';
} else {
$foretag = '%' . $foretag . '%';
}
$result = mysql_query ("SELECT * FROM Kunder
WHERE KundNr LIKE '$kund_nr%'
AND Postadress LIKE '$postadress%'
AND Foretag LIKE '$foretag%'
GROUP BY Foretag
");
if ($row = mysql_fetch_array($result)) {
print ("<b>Data. Sorterade på företag:</b>");
print ("<P>");
do {
$orig = $row["Foretag"];
print ("<B>");
print ("<P>");
$trans = get_html_translation_table (HTML_ENTITIES);
$encoded = strtr( $orig, $trans);
print $encoded;
print ("</B>");
print (" ");
print $row["Division"];
print (" ");
print $row["TfnVaxel"];
print (" ");
print $row["Fax"];
print (" ");
print $row["Kundansvarig"];
print (" ");
print $row["Postadress"];
print (" ");
print $row["Besoksadress"];
print (" ");
print $row["Leveransadress"];
print (" ");
print $row["Postnummer"];
print (" ");
print $row["Ort"];
print (" ");
print $row["Land"];
print (" ");
print $row["Postgiro"];
print (" ");
print $row["Bankgiro"];
print (" ");
print $row["RegNr"];
print (" ");
print $row["KundNr"];
print ("<P>");
} while($row = mysql_fetch_array($result));
} else {print "Sorry, no records were found!";}
echo "\nSearch complete.\n";
?>
</body>
</html>
This is a tiny piece from the MySQL import script:
INSERT INTO Kunder
VALUES (
'10020',
'Nya företaget AB',
NULL,
NULL,
'Trevägen',
NULL,
'745 67',
'VÄSTERÅS',
NULL,
'025-360000',
'024-185679',
NULL,
NULL,
NULL,
NULL,
NULL )\g
--
Michel Laine
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]