==========================================
九九乘法表
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <? //第一个循环 for($i=1;$i<=$a;$i++) { //第二个循环 for($j=1;$j<=$a;$j++) { //计算相乘的结果 $c = $i * $j; echo "$i x $j = $c " ; } echo '<p>'; } ?> |
===========================================
诗人博客,汉化整理,转载请注明 127.0.0.1/bluenoob2013
===========================================
//show.php 01:42:21
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 | <? //------[ 基本设定 ]------- $mysql_server_name = "localhost"; $mysql_username = "数据库用户名"; $mysql_password = "数据库密码"; $mysql_database = "数据库库名"; $sql = "select * from 数据库表名"; //------- $conn=mysql_connect( $mysql_server_name, $mysql_username, $mysql_password ); $result=mysql_db_query( $mysql_database, $sql,$conn ); $row=mysql_fetch_row($result); //表格开始 echo "<table border=1 cellspacing=0 cellpading=0>\n"; //印出栏位名称 echo "<tr>\n"; for($i=0;$i<mysql_num_fields($result);$i++) //有多少栏位 { echo "<td nowrap>" . mysql_field_name($result,$i) . "</td>\n"; } echo "</tr>\n"; |
==========================================
会员登录关闭
注册会员关闭