| <table width= "100%" border= "0" valign= "Top" align= "center" cellpadding= "0" cellspacing= "0" > <tr> <TD valign= "Top" >
<table width= "border=" 0 "align=" center "cellpadding=" 0 "cellspacing=" 1 "bgcolor=" #cccccc "class=" All "id=" tr " > <tr <td align= "center" bgcolor= "#d4e6ec" >ID</TD> <td height= "align=" "left" bgcolor= "#d4e6ec" > title </td <td align= "left" bgcolor= "#d4e6ec" > Date </td> </tr> <?php Include_once ("page.php");? > <?php $conn =mysql_connect ("localhost", "root", "") or Die (" Unable to connect to database tutorial: ". Mysql_error ()); $db =mysql_select_db ("dbtest") or Die ("Select Database error:". Mysql_error ()); mysql_query ("Set names gb2312"); $sql = "SELECT * FROM Test-id"; Genpage ($sql, 3); This refers to the first function, followed by a number that defines the number of records per page $result =mysql_query ($sql) or Die ("Database operation error:". Mysql_error ()); while ($row =mysql_fetch_array ($result)) { ?> <tr > <TD width= "align=" "Center" bgcolor= "#ffffff" ><?php echo $row [' id ']?> </td> <TD width= "383" height= "align=" "left" bgcolor= "#ffffff" ><?php echo $row [' title ']?></td> <TD width= "162" align= "left" bgcolor= "#ffffff" ><?php echo $row [' editdate ']?></td> </tr> <?php } ?> <tr> <TD height= colspan= "3" align= "center" bgcolor= "#d4e6ec" ><?php showpage ();//This refers to the second function?></td> </tr> </table> |