十天学会php之第九天
学习目的:注意事项
因为我是先学ASP的,所以再做PHP的时候会发现很多地方需要适应。
1、注意不要漏了分号
2、注意不要漏了变量前的$
3、使用SESSION的时候注意不要遗漏session_start();
如果发生错误的时候,可以采用以下方法:
1、如果是SQL语句出错,就注释了然后输出SQL语句,注意也要注释调后续的执行SQL语句
2、如果是变量为空,大多是没有传递到位,输出变量检查一下,检查一下表单的id和name
3、如果是数据库连接出错,检查是否正确打开MY SQL和是否遗漏了连接语句
4、注意缩进,排除括号不区配的错误
在做大网站的时候,我的思路是先构建数据库,确定每一个字段的作用,和表之间的关系。然后设计后台界面,从添加数据开始做起,因为添加是否成功可以直接到数据库里面验证,做好了添加再做显示的页面,最后才是两者的结合。一般来说后台就包括添加删除修改和显示,后台没有问题了,前台也没有什么大问题。前台还需要注意安全性和容错还有就是输出格式。
好了,今天说到这里,明天说一下如果用PHP上传文件和发邮件。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Logging in CakePHP is a very easy task. You just have to use one function. You can log errors, exceptions, user activities, action taken by users, for any background process like cronjob. Logging data in CakePHP is easy. The log() function is provide
