<br><br><p><DEFANGED_div><DEFANGED_span class="gmail_quote">On 9/25/07, <b class="gmail_sendername">Topher</b> <<a href="mailto:topher@wcsg.org">topher@wcsg.org</a>> wrote:</DEFANGED_span><blockquote class="gmail_quote" DEFANGED_style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> A more dynamic approach might be<br>> <?<br>><br>> $sql="SELECT st_abrv FROM schema.table-with-st_abrv ORDER BY st_abrv;";<br>><br>> So I ask, which would you prefer?<br><br>I'd do something similar to three for something like states. However,
<br>also for something like states I'd get all the states into an array<br>somewhow, whether it be by manually creating it, or generating it with<br>your sql call.</blockquote><p><DEFANGED_div><br>If I were to put all the values of the states into an array in an included file
<br><br>$array=array(MI,{...});<br><br><?<br>include "file-with-variables";<br><br>print ("<select>");<br><br>foreach ($array as $value) { // $array is defined in "file-with-variables"
<br><br> print (<option value=$value>$value</option>);<br><br>}<br><br>print ("</select>");<br><br>Where are the elements of the array stored, are they held in the servers memory, or the clients?
<br><br>So if 50 clients connect, will each store their own variables, or will the variables be stored 50 times in the server's memory?<br><br>If the latter is true, than it would make more sense to draw that array in then free the results, rather than include the array as a variable.
<br><br></p><DEFANGED_div><br><blockquote class="gmail_quote" DEFANGED_style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Once you have it in an array you can do all sorts of things like make a<br>
drop list, easily mark one option item "selected", or whatever.<br><br>Topher<br>Manager of Internet Services<br>Cornerstone University Radio<br><br>------<br>perl -e 'print join "", (map({chr(hex(/usr/bin/pine))} (shift =~ /\w{2}/g))),"\n"' \
<br>4920776973682049206B6E6577204865782E00<br>_______________________________________________<br>grlug mailing list<br><a href="mailto:grlug@grlug.org">grlug@grlug.org</a><br><a href="http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug">
http://shinobu.grlug.org/cgi-bin/mailman/listinfo/grlug</a><br></blockquote></p><DEFANGED_div><br><br clear="all"><br>-- <br>In vino veritas.<br> [In wine there is truth.]<br> -- Pliny