日期:2014-05-17 浏览次数:21011 次
<?php
2 define('CLIENT_MULTI_RESULTS', 131072);
3
4 $link = mysql_connect("127.0.0.1", "root", "",1,CLIENT_MULTI_RESULTS) or die("Could not connect: ".mysql_error());
5 mysql_select_db("vs") or die("Could not select database");
6 ?>
7
8 <?php
9 $result = mysql_query("call get_news_from_class_id(2)") or die("Query failed:" .mysql_error());
10 while($row = mysql_fetch_array($result, MYSQL_ASSOC))
11 {
12 $line = '<tr><td><a target = _blank href=\''.$row["url"].'\'>'.$row["title"].'('.$row["page_time"].')'.'</a></td></tr>';
14 echo $line;
15 printf("\n");
16
17 }
18 mysql_free_result($result);
19 ?>
20
21 <?php
22 mysql_close($link);
23 ?>