whereclause =['where id = ''',ed3,''''];
update(conn,tablename,colnames,xg11,whereclause);
上面这种方式就更新不了,但是程序不会报错。
下面这种方式就可以正常更新。
whereclause ='where id = 31';
update(conn,tablename,colnames,xg11,whereclause);
请问这是什么原因呢?
ed3=get(handles.edit3,'String');
whereclause=strcat('where id= ',ed3);使用拼接函数就可以了。