\n"); odbc_exec($db, "BEGIN WORK"); odbc_exec($db, $sql); odbc_exec($db, "COMMIT WORK"); } } if ($_REQUEST["list"] || !$_REQUEST["edit"]) { // Show list echo( "
Customer List
\n" . "
\n"); $result = odbc_exec($db, "select * from customers"); $cnt = 0; while (odbc_fetch_row($result) && $cnt++ < 10) { $custno = odbc_result($result, "custno"); echo("
\n"); echo( "
" . "
$custno
" . "
\n" . "
" . odbc_result($result, "matchcode") . "
\n" . "
" . odbc_result($result, "name1") . "
\n"); echo("
\n"); } echo("
\n"); } else { // Edit data record $custno = $_REQUEST["edit"]; echo( "
Edit Customer $custno
\n" . "
" . "
\n"); $result = odbc_exec($db, "select * from customers where custno='$custno'"); $ncol = odbc_num_fields($result); for ($i = 1; $i <= $ncol; $i++) { if (odbc_field_type($result, $i) != "VARCHAR") continue; $col_name = odbc_field_name($result, $i); echo( "
$col_name
"); if ($col_name == "CUSTNO") { echo( "
" . "$custno" . "
" . "
"); } else { echo( "
" . "
" . "
"); } echo("
\n"); } echo( "
\n\n" . "
\n" . "
\n"); } ?>
2003-06-11, Roland Genske, Marxmeier Software AG