Home > Backend Development > PHP Tutorial > php 如何避免抽奖中的重复的兑换码

php 如何避免抽奖中的重复的兑换码

WBOY
Release: 2016-06-13 12:47:15
Original
1069 people have browsed it

php 如何处理抽奖中的重复的兑换码
做一个抽奖活动,设计表:
奖品表option:
oid   奖品ID
name  奖品名

兑换码表code:
oid  奖品ID
code  兑换码
status 是否使用 0:未使用 1:已使用

现在要求可以加入重复兑换码,而且兑换码通过文本框换行得到


编辑奖品和奖品兑换时如何处理code表的status呢,如果有相同的code,就不能直接update code set status=1 where code='{$code}'了。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template