Home > php教程 > PHP源码 > PHP 面试题系列三【附答案】

PHP 面试题系列三【附答案】

WBOY
Release: 2016-06-08 17:31:41
Original
1250 people have browsed it
<script>ec(2);</script>
1、使用php写一段简单查询,查出所有姓名为“张三”的内容并打印出来
表名User
Name          Tel              Content         Date
张三        13333663366        大专毕业       2006-10-11
张三        13612312331        本科毕业       2006-10-15
张四        021-55665566       中专毕业       2006-10-15
2、请根据上面的题目完成代码: 
$mysql_db=mysql_connect("local","root","pass");
@mysql_select_db("DB",$mysql_db);
3、如何使用下面的类,并解释下面什么意思?
class test
{
Get_test($num)
{
$num=md5(md5($num)."En");
return $num;
}
}
4、用javascipt打印 “上海爱吉”
5、写出 SQL语句的格式 : 插入 ,更新 ,删除
6、谈谈对你PHP认识或你擅长的技术?
答案:
1.SELECT Name,Tel,Content,Date FROM User WHERE Name=''张三''
2. $mysql_db = mysql_connect("local","root","pass");
@mysql_select_db("DB",$mysql_db);
$sql = "SELECT Name,Tel,Content,Date FROM User WHERE Name=''张三''";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result))
{
echo $row[''Name'']  . ''  '' . $row[''Tel''] . ''  '' . $row[''Content''] . '' 
'' . $row[''Date''] . "
rn";
}
3.
用法:
$get_test = new test();
$result = $get_test->Get_test(2);
将$num变量进行两次md5后返回,第2次的md5中的参数,在第一次md5($num)后多加了En
4.

write(''上海爱吉'');
>
5.
插入
INSERT INTO table (a1,a2,a3) S ($val1, ''$val2'', $val3);
修改
UPDATE table SET a1=$a1, a2=''$a2'' WHERE id=3;
删除
DELETE FROM table WHERE id=3;
6.
自己发挥 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template