【发布时间】:2012-07-26 02:37:25
【问题描述】:
我的代码不起作用。 它只是打印出默认值
这里是php
$updatesQuery = "SELECT * FROM updates WHERE Isnote = 0";
$rs = mysql_query($updatesQuery) or
die("SQL: $usersQuery)<br />".mysql_error());
while($row = mysql_fetch_array($rs)) {
switch ($i){
case $row[CatID]=1:
$i = "kunder";
break;
case $row[CatID]=2:
$i = "bokningar";
break;
case $row[CatID]=3:
$i = "offerter";
break;
case $row[CatID]=4:
$i = "leverantorer";
break;
case $row[CatID]=5:
$i = "kalender";
break;
default:
$i = "no work";
break;
}
echo $i;
}
sql 查询有效。 但我的输出只是默认值。 “没有工作”。
我写错了什么?
【问题讨论】:
-
$i dude 的价值是多少...
标签: php arrays switch-statement case