php程序設計期末試題,php程序設計試卷A參考答案

本文目錄一覽:

php程序設計期末考試題目,應該php語言編寫程序,mysql資料庫伺服器創建一個資料庫,資料庫

如果沒具體要求的話,可以百度一個,網上有很多免費的,就是得自己測試是否能用,如果有具體要求就得動手做了,具體私聊哦

php程序設計選擇題

a.

a.

a.

d. Select * from employees where 姓名 like 『%文%』

d.

d.

b.

cd.

b.

PHP程序設計試卷

1、”php”

2、?和?php ; ?php和?

3、賦值 ; 判斷

4、5

5、這個題太無聊 是在考轉義

6、你簡直太棒了!

7、資料庫地址 ; 資料庫用戶名

php簡單編程題!!急急急!

?php

header(‘Content-type: text/html; charset=utf-8’);

/**

 * 驗證用戶名,只能有數字字母下劃線,不能數字開頭,長度6-20

 * @param string $name 用戶名

 * @return bool

 */

function username_verify($name) {

    return (bool)preg_match(‘/^(_|[a-z])\w{5,19}$/i’, $name);

}

/**

 * 驗證密碼:數字,下劃線,字母,6-16位

 * @param string $pw 密碼

 * @return bool

 */

function password_verify($pw) {

    return (bool)preg_match(‘/^\w{6,16}$/i’, $pw);

}

/**

 * 判斷學生成績等級

 * @param  int $score 成績

 * @return mixed

 */

function score_level($score) {

    if ($score0 || $score100) {

        return false;

    }

    if ($score = 90) {

        return ‘a級’;

    } elseif ($score = 80) {

        return ‘b級’;

    } elseif ($score = 70) {

        return ‘c級’;

    }

}

php小程序設計題

$con = mysql_connect(“localhost”,”root”,’123456′);

$mysql_select_db(“lesson”,$con);

mysql_query(“set names utf8”);

$sql = “select count(*) from student where math80 and english80”;

$num = mysql_query($sql);

echo “數學和英語成績均大於等於80分的學生總數:” . $num;

$sql1 = “select * from student where math80 and english80”;

$arr = mysql_query($sql1);

$str = “table border=’1’trth姓名/thth總分/th/tr”;

while($row = mysql_fetch_assoc($arr))

{

$str .= “tr”;

$str .= “td” . $row[‘name’]. “/td”;

$str .= “td” . $row[‘math’]+$row[‘english’]. “/td”;

$str .= “/tr”;

}

echo $str;

mysql_close($con);

原創文章,作者:WGLM,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/140735.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
WGLM的頭像WGLM
上一篇 2024-10-04 00:24
下一篇 2024-10-04 00:24

相關推薦

發表回復

登錄後才能評論