含有变量的sql写法
正确写法
如"UPDATE postinfo_admin SET title = '"+title+"',content ='"+content+"' WHERE postID ='"+postID+"'";
错误写法
"UPDATE postinfo_admin SET title = '"+title+"'content ='"+content+"' WHERE postID ='"+postID+"'";
两个的比较 错误写法少了 逗号
"UPDATE postinfo_admin SET title = '"+title+"',content ='"+content+"' WHERE postID ='"+postID+"'";
如果少了个逗号是错的 所以 细心 要
数据库里的字段一定要给足够的空间,要不然执行插入或者更新的时候无法进行