hy everyone!
got a litte problem with a switch statement....
a number should be counted from mysql and should give out the right output table. (I transformed the variable for this post)
the script exits automaticly after the 2nd condition...
everything that is greater than 20 would'nt be shown!!
the script should look like this:
< 10 --> 1
10 --> 2
20 --> 3
30 --> 4
40 --> 5
i got no clue why my script sucks!
ideas?
thx......
$zahlasdf = "19";
$berW = '<table border="0" cellpadding="0" cellspacing="4"><tr valign="top">';
$berR = '<table border="0" cellpadding="0" cellspacing="4"><tr valign="top">';
switch ($zahlasdf) {
case $zahlasdf < 10:
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb1.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr1.gif" width="14" height="14"></td>';
break;
case $zahlasdf > 10:
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb1.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb2.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr1.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr2.gif" width="14" height="14"></td>';
break;
case $zahlasdf > 20:
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb1.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb2.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb3.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr1.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr2.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr3.gif" width="14" height="14"></td>';
break;
case $zahlasdf > 30:
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb1.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb2.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb3.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb4.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr1.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr2.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr3.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr4.gif" width="14" height="14"></td>';
break;
case $zahlasdf > 40:
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb1.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb2.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb3.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb4.gif" width="14" height="14"></td>';
$berW .= '<td width="14" height="14"><img src="../../../img/antours_company_dlb5.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr1.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr2.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr3.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr4.gif" width="14" height="14"></td>';
$berR .= '<td width="14" height="14"><img src="../../../img/antours_company_dlbr5.gif" width="14" height="14"></td>';
break;
}
$berW .= '</tr></table>';
$berR .= '</tr></table>';