我有一个问题,强调一个广告-需要为增强和非增强的广告的不同设计!
我的表是这样的:
id int(11) UNIQUE // the unique id of the row
adresse text // the adress of an advertisement
fremhaevninger int(11) // the number of emphasizings of the ad
dato datetime // when the row was added我需要有一个脚本,可以返回我,例如像这样的变量
$enhanced = 1;
if 'fremhaevninger' > 0 - else
$enhanced = 0;注意:'fremhaevninger‘可以是0到99.999.999.999之间的任何值
这有可能吗?
发布于 2010-02-12 09:32:04
使用IF()
SELECT
otherfields,
IF(fremhaevninger > 0, 1, 0) AS enhanced
FROM
....https://stackoverflow.com/questions/2249026
复制相似问题