DELIMITER $$ CREATE TRIGGER tri_price BEFORE INSERT ON tb_commodity FOR EACH ROW BEGIN DECLARE tmp1 CHAR(20); DECLARE tmp2 CHAR(20); SET tmp1 = NEW.cname; SET tmp2 = ________; IF (tmp1= '电视机') && (_____= '上海') THEN SET ________ = 2800; END $$ DELIMITER ; DELIMITER $$ CREATE PROCEDURE sp_counter(________ ROWS INT) BEGIN DECLARE cid INT; DECLARE FOUND BOOLEAN DEFAULT TRUE; DECLARE cur_cid CURSOR FOR SELECT cno FROM tb_commodity; DECLARE CONTINUE HANDLER FOR NOT FOUND SET FOUND=FALSE; SET ROWS=0; OPEN cur_cid; FETCH cur_cid INTO cid; WHILE FOUND DO SET ROWS=ROWS+1; ________ cur_cid INTO cid; END WHILE; ________ cur_cid; END $$ DELIMITER ;
<?php $con=mysql_connect("localhost:3306","root","") or die("数据库服务器连接失败!<br>"); //**********found********** __________("db_mall",$con) or die( "数据库选择失败!<br>"); //**********found********** mysql_query("set __________ 'gbk'"); //**********found********** $sql="__________ tb_commodity SET price=3888"; //**********found********** $sql=$sql." ________ cname='电冰箱' AND origin='武汉'"; //**********found********** if (mysql_query(__________,$con)) echo "商品价格修改成功!<br>"; else echo "商品价格修改失败!<br>"; ?>