나는 현재 mysqli/PDO로 점프하고 있으며, SELECT 루프를 "old"메쏘드에서 mysqli로 변환 중이다.Mysqli "SELECT * FROM"loop
이if ($pending_stmt=$mysqli->prepare('SELECT * FROM transactions WHERE status = ?')) {
$pending_stmt->bind_param('s', $status); //$status is set prior to if statement
$pending_stmt->execute();
$pending_stmt->store_result();
$pending_stmt->fetch_all();
$rows=$pending_stmt->num_rows();
$i=0;
while ($i < $rows) {
$f1=$pending_stmt->fetch($i,'pcode');
//echo out to table here
$i++;
}
}
말할 필요 :
$query="SELECT * FROM transactions ORDER BY id DESC LIMIT 10";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"name");
$f2=mysql_result($result,$i,"surname");
$f3=mysql_result($result,$i,"pcode");
$f4=mysql_result($result,$i,"transaction_id");
$f5=mysql_result($result,$i,"articles");
$f6=mysql_result($result,$i, "delivery");
//echo out to table here
$i++;
}
그때까지 기본 mysqli 쿼리로 얻고, 한 간단하게 위의 while 루프를 복제하려고 시도 : "오래된"방법은
, 그것은 작동하지 않는 ... 그리고 많은 검색 후, 나는 누군가가 나에게 몇 가지 포인터를 제공만큼 친절하게 될지 궁금해.
당신이 다음 "이 작동하지 않습니다"더 명시 될 수 있을까? – antlersoft
작동하지 않습니다 ... 결과가 반환되지 않습니다. –