[html] [/html] [codebox] [/codebox] [sql] [/sql] [code]
examples:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>W3C HTML Home Page</title>
<meta name="keywords"
content="HTML, HTML 4, HTML 4.01, HTML 4.0, XHTML, XHTML 1.0, XHTML 1.1, XHTML Basic, Modularization of XHTML, XML Events, XHTML-Print, XHTML 2.0, HTML Activity, HTML Working Group" />
<meta name="description"
content="This is W3C's home page for the HTML Activity. Here you will find pointers to our specifications for HTML/XHTML, guidelines on how to use HTML/XHTML to the best effect, and pointers to related work at W3C." />
<link rel="stylesheet" type="text/css" href="markup.css" />
<link rel="stylesheet" type="text/css" href="../StyleSheets/public.css" />
<link rel="stylesheet" type="text/css" media="handheld"
href="style/handheld.css" />
<link rel="stylesheet" type="text/css" media="print" href="style/print.css" />
// associative arrayfunction build_select_box_from_array ($vals, $select_name, $checked_val = FALSE) { /* Takes one array, with the array keys being the displayed name and the array values as the values. The second parameter is the name you want assigned to this form element. The third parameter is optional. Pass the value of the item that should be checked. */ $str = sprintf('<SELECT name="%s">', $select_name); $optionStr = '<OPTION value="%s"%s>%s</OPTION>'; $selected = " selected"; $notSelected = ""; foreach ($vals as $key => $value) { if($value == $checked_val) { $sel = $selected; } else { $sel = $notSelected; } $str .= sprintf($optionStr, $value, $sel, $key); } $str .= "</SELECT>"; return $str;}
SELECT t.tid FROM a_table t WHERE t.val="This Value"