従業員データ 検索フォーム

検索したい従業員の部門を選択して送信ボタンを押してください。

" ); exit; } // SQLを作成 $sql = "select dept_no, name from department"; // Queryを実行して検索結果をresultに格納 $result = pg_query( $conn, $sql ); if ( $result == null ) { print( "クエリー実行処理でエラーが発生しました。
" ); exit; } // 検索結果の行数を取得 $rows = pg_num_rows( $result ); // 検索結果を選択肢として表示 for ( $i=0; $i<$rows; $i++ ) { // 部門の選択のためのラジオボタンを表示 $dept_no = pg_fetch_result( $result, $i, 0 ); $dept_name = pg_fetch_result( $result, $i, 1 ); print( " $dept_name
\n" ); } // 全ての部門の選択肢のラジオボタンを表示 print( "全ての部門
\n" ); // 検索結果の開放 pg_free_result( $result ); // データベースへの接続を解除 pg_close( $conn ); ?>


操作メニューに戻る