PHP:array_multisort(): Array sizes are inconsistent오류
조회수 2132회
이 오류가 왜 뜨고 어떻게 해결할 수 있는지 알려주세요.
<?php
include("C:/xampp/htdocs/include/lib.php");
include("C:/xampp/htdocs/include/top.php");
?>
<?php $_SESSION['msg'] = ""; ?>
<?php
if($_POST){
if(isset($_POST['in_date'])){
$client = $_POST['client'];
$product = $_POST['product'];
$ea = $_POST['ea'];
$in_date = $_POST['in_date'];
if($client == "거래처선택"){$_SESSION['msg'] .= "거래처가 누락되었습니다. <br>";}
if($product == "제품선택"){$_SESSION['msg'] .= "제품명이 누락되었습니다. <br>";}
if(!$ea){$_SESSION['msg'] .= "제품개수가 누락되었습니다. <br>";}
if(!$in_date){$_SESSION['msg'] .= "출고날짜가 누락되었습니다. <br>";}
$re = sql("select * from stock where name='$product'");
$da = fe($re);
$ea_array = explode("/",$da['ea']);
$price_array = explode("/" ,$da['price']);
$date_array = explode("/", $da['date']);
$ea_num = 0;
for($i = 0; $i<count($ea_array); $i++){
$ea_num += $ea_array[$i];
}
if($ea_num < $ea){$_SESSION['msg'] .= "제품개수가 잘못 입력되었습니다.";}
if($_SESSION['msg'] == ""){
$array = array();
for($i = 0; $i<count($ea_array); $i++){
$array = array("ea" => $ea_array[$i] , "price" => $price_array[$i] , "date" => $date_array[$i]);
}
array_multisort($array,array('date' => SORT_ASC));
print_r($array);
/* sql("insert into out_pro(client,product,ea,in_price,out_pro,margin,totalprice,date) values('$client','$product',");*/ //out_pro에 넣으려고 했는데 보류
}
}else{
}
}
?>
<div class="msg">
<?php echo $_SESSION['msg']; ?>
</div>
<div class="title">출고관리</div>
</div>
</div>
<div id="con">
<div class="wrap store">
<form method = "post" action = "/page/out_pro.php">
<div>
<span class="red">*</span> 거래처 :
<select name = "client">
<option value="거래처선택">거래처선택</option>
<?php
$re = sql("select name from client order by name asc");
while($da = fe($re)){
?>
<option value = "<?php echo $da['name']; ?>"><?php echo $da['name']; ?></option>
<?php } ?>
</select>
<span class="red">*</span> 제품명 :
<select name = "product">
<option value="제품선택">제품선택</option>
<?php
$re = sql("select * from product order by name asc");
while($da = fe($re)){
?>
<option value = "<?php echo $da['name']; ?>"><?php echo $da['name']; ?></option>
<?php } ?>
</select>
<span class="red">*</span> 제품개수 : <input name = "ea" type="text" style="width:70px;">
<span class="red">*</span> 출고날짜 : <input type="text" name = "in_date" id="in_date" style="width:150px; text-align:center;">
<input type = "submit" value = "출고하기">
</div>
</form>
<div class="in_search">
거래처 :
<select name = "client">
<option value = "전 체">전 체</option>
<?php
$re = sql("select name from client order by name asc");
while($da = fe($re)){
?>
<option value = "<?php echo $da['name']; ?>"><?php echo $da['name']; ?></option>
<?php } ?>
</select>
제품별 :
<select name = "product">
<option value = "전 체">전 체</option>
<?php
$re = sql("select * from product order by name asc");
while($da = fe($re)){
?>
<option value = "<?php echo $da['name']; ?>"><?php echo $da['name']; ?></option>
<?php } ?>
</select>
시작날짜 : <input type="text" name = "s_date" id="s_date" style="width:150px; text-align:center;">
마지막날짜 : <input type="text" name = "e_date" id="e_date" style="width:150px; text-align:center;">
<button>검색하기</button>
</div>
<div class="s_list" >
<div class="se_re">
"거래처 : <span class="red"></span>", "제품명 : <span class="red"></span>",
"시작날짜 : <span class="red">이상</span>", "마지막날짜 : <span class="red"> 이하</span>"
</div>
<div class="se_re2">
총 <span class="red"></span> 건, 전체마진 <span class="red"></span> 원,
전체출고총액 : <span class="red"></span> 원
</div>
<table class="list mat40">
<tr>
<th>거래처</th>
<th>제품명</th>
<th>출고개수(총개수)</th>
<th>입고가</th>
<th>출고가</th>
<th>마 진</th>
<th>출고총액</th>
<th>출고날짜</th>
</tr>
<tr>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>-</td>
</tr>
</table>
<div class="w100 ac mat20">
<button>이전</button>
<button>1</button>
<button>다음</button>
</div>
</div>
</div>
</div>
</body>
</html>
DB구조 입니다.
product
stock
stock의 데이터들
아 참고로 product테이블의 no필드와 stock테이블의 idx는 autoincrease입니다.
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력