找回密码
 加入
搜索
查看: 2121|回复: 5

[AU3基础] mysql 插入中文插入不进去 是怎么回事啊

[复制链接]
发表于 2016-8-10 09:27:06 | 显示全部楼层 |阅读模式
[code]
#include <array.au3>
#include "mysql.au3"
_MySQL_InitLibrary()
If @error Then Exit MsgBox(0, '', "could nit init MySQL")
$MysqlConn = _MySQL_Init()   ;&#1333;&#700;&#1775;

$connected = _MySQL_Real_Connect($MysqlConn, "localhost", "root", "admin", "360cx")   ;l&#1939;&#765;&#2013;&#2082;ì
If $connected = 0 Then Exit MsgBox(16, 'Connection Error', _MySQL_Error($MysqlConn))
_MySql_Query($MysqlConn,"SET NAMES UTF8");

;*******************&#1896;b&#765;&#2013;&#2082;;********************
$query = "INSERT INTO `360cx`.`money` (`user` ,`password` ,`yesterday` ,`month` ,`id`)VALUES ('按错', '的啊啊', '萨达', '按到啊', '8')"  ;&#1896;b&#765;&#2013;&#2082;
$mysql_bool = _MySQL_Real_Query($MysqlConn, $query)  




If $mysql_bool = $MYSQL_SUCCESS Then
    MsgBox(0, '', "Query OK")
Else
    $errno = _MySQL_errno($MysqlConn)
    MsgBox(0,"Error:",$errno & @LF & _MySQL_error($MysqlConn))
EndIf

$res = _MySQL_Store_Result($MysqlConn);&#1863;&#188;&#1257;&#1135;&#1816;4&#1412;&#1953;&#1723;

$fields = _MySQL_Num_Fields($res);8λ&#765;&#1816;&#1128;&#1283;&#1512;
$mysqlrow2 = _MySQL_Fetch_Row($res,$fields)
MsgBox("","",$mysqlrow2)


$rows = _MySQL_Num_Rows($res);&#1546;&#143;&#1162;&#765;&#1816;&#1128;&#1283;&#1512;
MsgBox(0, "&#1162;&#765;-&#1546;&#143;8λ","&#1162;&#765;:"&$rows & "-" & $fields&"8λ")



MsgBox(0, '', "&#1257;&#1135;&#1401;&#702; 1- &#726;&#1636;&#740;&#619;&#1211;&#1654;8λ&#1211;&#1654;8λ&#1473;&#545;")
Dim $array[$rows][$fields]
For $k = 1 To $rows


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2016-8-10 14:01:14 | 显示全部楼层
没有吗  自己帮忙订下
发表于 2016-8-10 17:04:52 | 显示全部楼层
回复 2# ak47gglllk

可以提供MYSQL 上面的資料欄位型態嗎??
发表于 2016-8-10 18:23:00 | 显示全部楼层
标点符号错了,输入标点符号时,要注意输入法的全角(半角)状态!
发表于 2016-8-10 22:36:48 | 显示全部楼层
很明显啊,提示你语法输错了,标点输出了,不关au3的问题
发表于 2016-8-10 23:21:17 | 显示全部楼层
你的编辑器不提示这个?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-20 22:34 , Processed in 0.077870 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表