searchrecord 表里面的 username 的数据类型, 是 char(32) ?
searchrecord 表里面的 type 的数据类型, 是 char(16) ?
还有就是你调用存储过程的时候, 是怎么调用的?
还有就是
select count(*),id,count INTO p_isexist,p_id,p_count from searchrecord Where username = usernamep And type = typep;
这个 sql 语句上面, 有点问题。
可以修改为
select count(*) INTO p_isexist from searchrecord Where username = usernamep And type = typep;
然后后面的
update searchrecord set opdate=NOW(),count = p_count +1 where id = p_id
修改为
update searchrecord set opdate=NOW(),count = count + 1 where username = usernamep And type = typep;