Affichage des articles dont le libellé est Mysql. Afficher tous les articles
Affichage des articles dont le libellé est Mysql. Afficher tous les articles
mardi 30 août 2011
I received many tutorial requests from my readers that asked to me how to display and store foreign/regional language UTF-8 data into MySQL database using PHP code. This post explains you to solve Unicode data problems, just there steps you should follow take a quick look at this post.
Database
Sample database articles table columns id, title and description. Character set should be UTF-8 format.
CREATE TABLE `articles`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(300) CHARACTER SET utf8 collate utf8_general_ci ,
`description` text CHARACTER SET utf8 collate utf8_general_ci,
PRIMARY KEY (`id`)
)
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(300) CHARACTER SET utf8 collate utf8_general_ci ,
`description` text CHARACTER SET utf8 collate utf8_general_ci,
PRIMARY KEY (`id`)
)
You can set this using PHPMyAdmin. Go to table structure and change collationlatin1_swedish_ci to utf8_general_ci
Insert - Why prefix 'N'?
SQL insert statement. Here the N stands for National language character set. Which means that you are passing an NCHAR, NVARCHAR or NTEXT value Read more.
INSERT INTO
articles(title,description)
VALUES
(N'శ్రీనివాస్ తామాడా', N'新概念英语第');
articles(title,description)
VALUES
(N'శ్రీనివాస్ తామాడా', N'新概念英语第');
HTML META TAG
You have to include this following tag in data results pages.
Useful Related Posts
Regional Language UTF-8 Text Box
Database Searching Techniques Regional Language.
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
charset=UTF-8" />
Displaying Records
Contains PHP code displaying records form database. Before that you have to specifymysql_query() function data character set type.
<?php
include('db.php');
mysql_query ("set character_set_results='utf8'");
$query = mysql_query("SELECT * FROM articles") or die(mysql_error());
while($row=mysql_fetch_array($query))
{
echo $row['title']; // Article
echo $row['description']; // Description
}
?>
include('db.php');
mysql_query ("set character_set_results='utf8'");
$query = mysql_query("SELECT * FROM articles") or die(mysql_error());
while($row=mysql_fetch_array($query))
{
echo $row['title']; // Article
echo $row['description']; // Description
}
?>
Hope this post helps your web project to reach global and regional(Indian languages). Thanks!
Yioop! is an open source search engine built with PHP and uses MySQL or SQLite for storing the data.
It can be configured to crawl any page it finds by following links or limited to any given number of URLs and used as an in-site search engine (like Google Custom Search).
A standard setup can crawl and index millions of pages per day and this number can be increased by running more crawlers (distributed setup is possible as well).
There is support for indexing many file types including HTML, DOC, PNG, JPG, GIF, XML, sitemaps, RSS and much more.
Also, the system can be controlled completely from a web-based administration interface.
Requirements: PHP 5.3+, MySQL or SQLiteWebsite: http://www.seekquarry.com/
Demo: http://www.yioop.com/
Download: http://www.seekquarry.com/?c=main&p=downloads
jeudi 25 août 2011
LiveCart is a PHP-MySQL-powered open source shopping cart application that comes with many features to create simple-to-advanced e-commerce websites.
The application is developed with usability in mind, has a distraction free clean page flow and offers an intuitive shopping experience.
Its navigation is very flexible with powerful product searching and filtering capabilities that enables users to easily drill-down to the level they want (like laptops>17" screen>X brand).
Requirements: PHP 5.2+, MySQL 4.1+Website: http://livecart.com/
Demo: http://demo.livecart.com/
Backend Demo: http://backend.livecart.com/backend
Download: http://livecart.com/download
Inscription à :
Articles (Atom)


