-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
37 lines (26 loc) · 863 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
include "admin_index.php"
mysql_select_db("simpress", $con);
$result_links = mysql_query("SELECT * FROM links");
$result_article = mysql_query("SELECT * FROM article");
$j=0;
$links=array();
while($row_links=mysql_fetch_array($result_links)){
$links[$j]=$row_links;
$j++;
}
$i=0;
$article=array();
while($row_article=mysql_fetch_array($result_article)){//这一句,就是判断是否还有数据没有取完,如果取完,会由数据库返回false,停止while循环,如果有,则继续;
$article[$i]=$row_article;
$i++;
}
include"smarty_inc.php";
$smarty = new Smarty();
$smarty->assign("links", $links);
$smarty->assign("article", $article);
$smarty->display("index.tpl");
//print_r($article);
//print_r($links);
mysql_close($con);
?>