Home > Backend Development > PHP Tutorial > php学习日记

php学习日记

WBOY
Release: 2016-06-13 10:56:07
Original
996 people have browsed it

php学习日志

1、php文件与数据库编码一致了,页面仍然乱码。检查后原来是 utf8与utf-8的问题。

???? mysql_connect("localhost","root","root");

???? mysql_query("set names uft-8;"); 换成 mysql_query("set names utf8");

?

2、对mysql_fetch_array、mysql_fetch_row、 mysql_fetch_assoc、mysql_fetch_object 有了基本的认识.

??? a、用mysql_fetch_array函数可以通过键名(字段名)与数字键获取值。如$row["user"]、$row[0]

??? b、mysql_fetch_row只能通过数字键获取字段值。如$row[0]

??? c、mysql_fetch_assoc则是通过$row["user"]获取值

??? d、mysql_fetch_object则是将每一行记录当成对象 每个字段相当与是 这个对象的 属性。

???????? 获取值方式 $row->user。

?

3、smarty安装不成功

???? 解压之后还需要设置config、templates等文件夹权限。

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template