\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( " \n" . " \n" . " \n"); echo("\n"); } echo("
" . "$custno" . "" . odbc_result($result, "matchcode") . "" . odbc_result($result, "name1") . "
\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( ""); if ($col_name == "CUSTNO") { echo( ""); } else { echo( ""); } echo("\n"); } echo( "
$col_name" . "$custno" . "" . "" . "" . "
\n\n" . "

\n" . "

\n"); } ?>


2003-06-11, Roland Genske, Marxmeier Software AG