ODBiC Discussion Board


Nested variables help

by Scott S, August 9, 2006 03:39

Hello everyone,

I would like to ask for a liitle help in a nest variable issue. I am passing variables generated from workorders into an update page. The Update page currently looks like th ebelow code. You will notice that the only this that changes from "else if" to "Esle if" if the variable id numbers.

Is there a way to use the $i$ variable in the base variable to reduce all the code down to a single command?

Thanks in advance for the help. Scott S.

<% SET i = 1 %>
<% WHILE $i$ <= $maxrows$ %>

<TR class="$if(mod($rowid$,2),altbluetable,bluetable)">

<% if $rownumber1$=$i$ AND $row1$=yes %> <% SELECT * FROM workorders WHERE id=$item1$ AND woid='$oldwoid$' ORDER BY partnumber %>

<% else if $rownumber2$=$i$ AND $row2$=yes %> <% SELECT * FROM workorders WHERE id=$item2$ AND woid='$oldwoid$' ORDER BY partnumber %>

<% else if $rownumber3$=$i$ AND $row3$=yes %> <% SELECT * FROM workorders WHERE id=$item3$ AND woid='$oldwoid$' ORDER BY partnumber %>

<% else if $rownumber4$=$i$ AND $row4$=yes %> <% SELECT * FROM workorders WHERE id=$item4$ AND woid='$oldwoid$' ORDER BY partnumber %>

ETC...ETC....ETC

<% ENDIF %> <% SET i = $i$ + 1 %> <% ENDWHILE %>



Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.