我是根據id來更新數據的。但是contact連接之後變成字符串了 如何解決啊!!!!
大家都是怎麼解決這種問題的呢!!!
問題已經解決:Sql如下:
DELIMITER//
DROP PROCEDURE IF EXISTS save_scheme_params;
CREATE PROCEDURE save_scheme_params(IN xid INT(11)UNSIGNED,IN nums INT(11),IN paramas VARCHAR(255),IN vals VARCHAR(255))
BEGIN
IF nums = 1 THEN
SET @sql = CONCAT('UPDATE t_scheme_info SET ',paramas,' = ?',' WHERE id = ?');
ELSE
SET @sql = CONCAT('UPDATE t_scheme_item SET ',paramas,' = ?',' WHERE id = ?');
END IF;
PREPARE stmt FROM @sql;
SET @vals = vals;
SET @id = xid;
EXECUTE stmt USING @vals,@id;
DEALLOCATE PREPARE stmt;
END
//DELIMITER
CALL save_scheme_params(1,1,'lease_model_info','測試中');