<?php
$dopage->GetPage("SELECT * FROM `#@__unameym` WHERE uname='$c_uname' ORDER BY id DESC");
if ($dosql->GetTotalRow() > 0)
?>
<?php
# $row3=[];
while($row = $dosql->GetArray())
{
$row3 =array( $row['ypname']);
$row5 = array(end($row3));
# ?>
# <?php
var_dump ($row5);
//輸出為
array(1) { [0]=> string(4) "a凱" } array(1) { [0]=> string(12) "不老鹹蛋" } array (1) { [0]=> string(11) "維他命B2" } array(1) { [0]=> string(9) "維他命" } array(1) { [0]=> string (9) "小菜胡" } ,但是怎麼將$row5中的元素挨個的循環查詢?
}
# ?>
<?php
$dopage->GetPage("SELECT * FROM `#@__liuxiang` WHERE ypname='end($ row5)' ORDER BY id DESC",20);
if($dosql->GetTotalRow() > 0)
將表中查到的資料輸出到表裡面! ! !
foreach 可以這樣寫
foreach($row5 as $vo){
# echo $vo;
##}用for 循環,透過下標的方法,取得每個值,i=0;i<count($row);i++,依序循環查詢然後合併到一個陣列。