注册 登录
编程论坛 PHP技术论坛

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

kidy2005 发布于 2007-05-05 15:07, 1129 次点击

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

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.
请问各位高手怎么解决这个问题啊?

2 回复
#2
lmhllr2007-05-05 16:05
24小时内加引号看看
#3
kidy20052007-05-06 11:06

$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')

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

1