广州传奇网络
地址:广州市天河区东圃大马路富华楼C座
电话:13808825895
QQ:1564443073
mysql动态sql查询ecshop商品信息,为了高效的完成对ecshop商品的检索,有时候提前预编译sql。我们可以采用mysql的动态sql来检索ecshop的数据库。以下就是通过mysql动态sql语句来搜索ecshop商品信息。
set @a ="select * from ecs_goods";
set @b =" where goods_id =";
set @id ="1";
set @c = concat(@a,@b);
set @c = concat(@c,@id);
prepare st from @c;
execute st;
我们可以看到这样就取得了ecshop的商品详细信息。
set @str = "select * from ecs_goods where goods_id=?";
set @id=1;
prepare sa from @str ;
execute sa using @id;