题目内容

以下程序代码的输出结果为( )$conn = mysqli_connect('localhost','root','root','test');$result = mysqli_query($conn,'select id,name,sex from user where id=1');$data = mysqli_fetch_array($result);echo $data[0];

A. 1
B. 2
C. 0
D. 空值

查看答案
更多问题

有以下程序代码,其中能输出name的是( )$conn = mysqli_connect('localhost','root','root','test');$result = mysqli_query($conn,'select id,name,sex from user where id=1');$data = mysqli_fetch_object($result);

A. $data ['name']
B. $data [1]
C. $data->name
D. $data[0]

有以下程序代码,其中能输出name的是( )$conn = mysqli_connect('localhost','root','root','test');$result = mysqli_query($conn,'select id,name,sex from user where id=1');$data = mysqli_fetch_row($result);

A. $data[1]
B. $data[0]
C. $data->name
D. $data['name']

提交修改数据时通常给php程序传递当前修改数据的id,以下不可行的方法是()

A. 可在form的action路径加,如action="a.php?id=1"
B. 隐藏域加,如
C. 文本域加,如
D. 可在form的method中加,如method="post?id=1"

有以下程序代码,要如何写sql语句完成数据修改过程( )

A. update user set name="$_POST['name']"
B. update user set name="$_POST['name']" where id=$_POST['id']
C. update user set name=$_POST['name']
D. update user set name=$_POST['name'] where id=$_POST['id']

答案查题题库