Results 1 to 6 of 6

Thread: display unicode data in php

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    117

    display unicode data in php

    sir
    i created a database with following table in MySQL.
    Code:
    Field		Type	Collation
    Name		Varchar(50)   utf8_bin
    Age		int(11)
    i want to store unicode data in my table. when i insert unicode data into my table it worked correctly. but my proble is that when i write code in php to display the contents of table i get only question marks in the place of unicode data. why this happens... my code is below... please go through it and help me....

    PHP Code:
    <?php
    mysql_connect
    ("localhost","root","");
    mysql_select_db("mydata1");
    $result=mysql_query("SELECT * FROM mytable");
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <HEAD>
    <TITLE>
    Testing
    </TITLE>
    <meta http-equiv="content-type" content="text/html:charset=utf-8"/>
    </HEAD>
    <BODY>
    <TABLE border="1" cellpadding="2">
    <TR>
    <TH> NAME</TH>
    <TH>AGE</TH>
    </TR>
    <?php
    while ($row=mysql_fetch_array($result)) {
    echo 
    "<tr>";
    echo 
    "<td>"  .  $row['Name']  .  "</td>";
    echo 
    "<td>" $row['Age'] . "</td>";
    echo 
    "</tr>";
    }
    mysql_free_result($result);
    mysql_close();
    ?>
    </TABLE>
    </BODY>
    </HTML>
    Last edited by penagate; Jun 2nd, 2007 at 04:26 AM. Reason: Added code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width