Beispiel #1
0
                 //                    $rows=array();
                 while ($row = mysqli_fetch_array($result)) {
                     //                        $rows[0]=$row;
                     return $row;
                 }
                 mysqli_free_result($result);
                 //                    return $rows;
             }
         }
         $smarty = InitSmarty();
         //print_r($sql_query);exit;
         //                print_r(dis_td($sql,$con));
         $i = 0;
         $arr = array();
         foreach ($sql_query as $sql) {
             $sgk_data = dis_td($sql, $con);
             array_push($arr, $sgk_data);
             $i++;
         }
         $smarty->assign('num', $count);
         //                $smarty->assign('olPage',$i);
         //                $smarty->assign('pn',$pn);
         //                $smarty->assign('p',$p);
         $smarty->assign('key', $keyToSearch);
         $smarty->assign('datas', $arr);
         $smarty->display('user/sgk_data.tpl');
     } else {
         ShowError('骚年,木有搜索到啊!换个关键词试试看?', '#');
     }
 }
 break;
Beispiel #2
0
    //print_r($result); //显示结果
    $arr = $result["matches"];
    $sql_id = array();
    foreach ($arr as $k => $v) {
        $sql_id[$i] = $v["id"];
        $i++;
    }
    $sql_query = array();
    foreach ($sql_id as $id) {
        $sql = "select * from shegongku where id =" . $id;
        $sql_query[$i] = $sql;
        $i++;
    }
    //print_r($sql_query);   //显示原始的sql语句
    foreach ($sql_query as $sql) {
        dis_td($sql);
    }
    $ln = '?mode=' . $_GET['mode'] . '&key=' . $keyToSearch . '&she=' . $md5 . '&page=';
    $w = $pn - 1;
    echo "    </table>\n<div class=\"pager\">\n    <a href=\"{$ln}\">首页</a>";
    for ($i = 1; $i < $pn; $i++) {
        echo "<a href=\"{$ln}{$i}\">{$i}</a>";
    }
    echo "<a href=\"{$ln}{$w}\">尾页</a>\n</div>";
}
mysql_close();
?>

<div style="display: none" id="goTopBtn"><img border=0 src="assets/imgs/go_tu_top.png"></div>
<script type=text/javascript>goTopEx();</script>
</body>