PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, December 31, 2021

[FIXED] I want to use urdu in webpage using codeigniter framework?

 December 31, 2021     codeigniter, html, php, urdu, webpage     No comments   

Issue

I am developing a website using urdu in codeigniter framework. I want to load urdu in my webpages but I failed every time. I send urdu to database in uni code when I am trying to access urdu data and show it in webpage it show me some other things which is in attachment. This is screenshot of webpage

I already used meta tag below

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

How can I write urdu in webpage using codeigniter framework.


Solution

Step : 1 - Go to table structure and change collation latin1_swedish_ci to utf8_general_ci

Step : 2 - You have to include this following tag in data results pages.

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Step :3 - Insert 'N' Prefix. Here the N stands for National language character set. Which means that you are passing an NCHAR, NVARCHAR or NTEXT value

Step :4 - PHP code displaying records form database. Before that you have to specify mysql_query() function data character set type

<?php
include('db.php');
mysql_query ("set character_set_results='utf8'"); 
$query = mysql_query("SELECT * FROM books") or die(mysql_error());
while($row=mysql_fetch_array($query))
{
echo $row['id']; // Book id 
echo $row['books_title']; // Book title
}
?>


Answered By - Rana Ghosh
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing