prepare($sql); $stmh->bindValue(1, $num, PDO::PARAM_STR); $stmh->execute(); $row = $stmh->fetch(PDO::FETCH_ASSOC); $outdate=$row["outdate"]; $indate=$row["indate"]; $orderman=$row["orderman"]; $outworkplace=$row["outworkplace"]; $outputplace=$row["outputplace"]; $receiver=$row["receiver"]; $phone=$row["phone"]; $comment=$row["comment"]; } catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } if($outdate!="") { $week = array("(일)" , "(월)" , "(화)" , "(수)" , "(목)" , "(금)" ,"(토)") ; $outdate = $outdate . $week[ date('w', strtotime($outdate) ) ] ; } $pagenum=1; // 발주서 레코드 수량 파악해서 8개 이상이면 2페이지 이상 출력토록 만드는 서브루틴 if($sort=='1') $sql="select * from chandj.make where upnum='$upnum' order by num asc"; // 처음 오름차순 else $sql="select * from chandj.make where upnum='$upnum' order by num desc"; // 처음 내림차순 try{ $stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh $total_count=$stmh->rowCount(); // print ""; } catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } // 배열선언 $text1=[]; $text2=[]; $memo=[]; $draw=[]; $drawbottom1=[]; $drawbottom2=[]; $drawbottom3=[]; try{ $stmh = $pdo->query($sql); // 검색조건에 맞는글 stmh $counter=0; while($row = $stmh->fetch(PDO::FETCH_ASSOC)) { $upnum=$row["upnum"]; if((int)$upnum==(int)$num) { $text1[$counter]=$row["text1"]; $text2[$counter]=$row["text2"]; $memo[$counter]=$row["memo"]; $draw[$counter]=$row["draw"]; $drawbottom1[$counter]=$row["drawbottom1"]; $drawbottom2[$counter]=$row["drawbottom2"]; $drawbottom3[$counter]=$row["drawbottom3"]; $start_num--; $counter++; } } } catch (PDOException $Exception) { print "오류: ".$Exception->getMessage(); } $recnum=8; //레코드수가 8개 넘으면 다음페이지로 출력 $limit=ceil($total_count/$recnum); // print ""; ?>