gpt4 book ai didi

php - 将印地语数据以特定字体(devlys)插入数据库

转载 作者:行者123 更新时间:2023-11-30 21:53:45 25 4
gpt4 key购买 nike

我想将数据插入印地语的 MySQL 表中。我的数据在 excel 中,它有字体 devlys 10.of 我复制并粘贴它在查询中它没有显示。但是,如果我从谷歌翻译器中复制一些印地文文本,它需要。我曾尝试将 CSV 用于该特定字体,但在导入后它不显示印地语而是显示特殊字符。

对于数据库、表格和其他我已经检查过的东西都为 utf 8 整理正确设置,效果很好。

如果我从翻译器插入数据,它会以印地语显示。所以问题是如何显示 devlys 10 印地语字体数据。?

这是我的代码...

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Demo - Import Excel file data in mysql database using PHP, Upload Excel file data in database</title>
<meta name="description" content="This tutorial will learn how to import excel sheet data in mysql database using php. Here, first upload an excel sheet into your server and then click to import it into database. All column of excel sheet will store into your corrosponding database table."/>
<meta name="keywords" content="import excel file data in mysql, upload ecxel file in mysql, upload data, code to import excel data in mysql database, php, Mysql, Ajax, Jquery, Javascript, download, upload, upload excel file,mysql"/>
</head>
<body>

<?php

define ("DB_HOST", "localhost"); // set database host
define ("DB_USER", "root"); // set database user
define ("DB_PASS",""); // set database password
define ("DB_NAME","uor"); // set database name

$link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Couldn't make b
connection.");
$db = mysql_select_db(DB_NAME, $link) or die("Couldn't select database");

$databasetable = "data";




set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/');
include 'PHPExcel/IOFactory.php';

// This is the file path to be uploaded.
$inputFileName = 'discussdesk.xlsx';

try {
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
} catch(Exception $e) {
die('Error loading file
"'.pathinfo($inputFileName,PATHINFO_BASENAME).'":
'.$e->getMessage());
}


$allDataInSheet = $objPHPExcel->getActiveSheet()-
>toArray(null,true,true,true);
$arrayCount = count($allDataInSheet); // Here get total count of row in
that
Excel sheet


for($i=1;$i<=$arrayCount;$i++){
$name = trim($allDataInSheet[$i]["A"]);
$email = trim($allDataInSheet[$i]["B"]);
//$hname = mb_detect_encoding($email);

if($name) {
mysql_set_charset('utf8');
$insertTable= mysql_query("insert into data (name, email)
values('".$name."',
'".$email."')");


$msg = 'Record has been added. <div style="Padding:20px 0 0 0;"><a
href="">Go
Back to tutorial</a></div>';
} else {
$msg = 'Record already exist. <div style="Padding:20px 0 0 0;"><a href="">Go
Back to tutorial</a></div>';
}
}
echo "<div style='font: bold 18px arial,verdana;padding: 45px 0 0
500px;'>".$msg."</div>";


?>
<body>
</html>

最佳答案

我认为 Excel 字体或任何其他字体不能存储在 db 中。只能存储数据

关于php - 将印地语数据以特定字体(devlys)插入数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46093665/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com