标题:如何解决数据库汉字插入显示问题
只看楼主
kidy2005
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2007-4-18
 问题点数:0 回复次数:2 
如何解决数据库汉字插入显示问题

如何解决数据库汉字插入显示问题

dijie! info: MySQL Query Error

Time: 2007-5-5 7:04am
Script: /cngmest/index.php

SQL: insert into t_carttemp ( strSessionID, intUserID, intGameID, intServerID, strServer, strCareer, intProductID, strName, intStart, intEnd, intQuanPer, strUnit, dblPrice, strUserName, strPassword, strComments, intType, intQuan, strTime, strCharacter, blnStock, dtAddDate, blnDelete, strLocationItem )values( '1178339129BU7ICK', '0', '1', '116', 'Zuluhed-H', '', '1', '50 G', 0, 0, '50', 'G', '10.02', '', '', '', '1', '1', 24小时内, '1', '', '1178348643', 0 , '通过客服' )
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? '1', '', '1178348643', 0 , '通过客服' )' at line 1
Errno.: 1064

An error report has been dispatched to our administrator.
请问各位高手怎么解决这个问题啊?

搜索更多相关主题的帖子: 数据库 汉字 SQL php 
2007-05-05 15:07
lmhllr
Rank: 8Rank: 8
等 级:贵宾
威 望:44
帖 子:1504
专家分:42
注 册:2005-5-12
得分:0 
24小时内加引号看看
2007-05-05 16:05
kidy2005
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2007-4-18
得分:0 

$strTime=24小时,是一个变量

我本来是这样写的:
insert into t_carttemp ( strSessionID, intUserID, intGameID, intServerID, strServer, strCareer, intProductID, strName, intStart, intEnd, intQuanPer, strUnit, dblPrice, strUserName, strPassword, strComments, intType, intQuan, strTime, strCharacter, blnStock, dtAddDate, blnDelete, strLocationItem )values( '$strSessionID', '$intUserID', '$intGameID', '$intServerID', '$strServer', '$strCareer', '$intProductID', '$strName', 0, 0, '$intQuanPer', '$strUnit', '$dblPrice', '', '', '', '$intType', '$intQuan', '$strTime', '$strCharacter', '$blnStock', '$dtAddDate', 0 , '$strLocationItem')

也是出现一样的问题,后来我才把引号去掉试试的


恒天装饰网:http://www.
2007-05-06 11:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-137044-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.075687 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved