php developers to build credit summary FAQ OA system source code disk lucky airship website

PHP is an easy to learn and use server-side scripting language. Syntax absorbed the C language, Java, and Perl features conducive to learning, widely used, mainly for Web development. PHP syntax unique mix of C, Java, Perl and PHP own syntax. It can perform dynamic than the CGI or Perl pages more quickly. Compared with dynamic PHP pages made with other programming languages, PHP is embedded into HTML program (an application under the Standard Generalized Markup Language) document to execute, execute efficient than completely CGI generated HTML markup is much higher; PHP can also be performed after the compiled code, the compiler can optimize the code to achieve encryption and run, make the code run faster.

Now learn php a lot of programmers in the development process often encountered a lot of problems, we are here for everyone summarizes the PHP development process is the most common of 10 questions, we want to be helpful in the development process.

Build OA credit disk lucky airship system source code website Q2947702644 [sweet potato] Source Forum fanshuym.com

Test Station: http://fanshuym.com/thread-434-1-1.html 

1, use MyISAM instead of InnoDB

  MyISAM is the default. But unless you are building a very simple database or just experimental, then to most of the time the choice is wrong. MyISAM does not support foreign key constraints, which is to ensure the data integrity of the essence ah. In addition, MyISAM will lock the entire table to add or update data in time, this will be a big problem in the future scalability.

2, using PHP's mysql method

  PHP offers from the start the MySQL library. Many programs rely on mysql_connect, mysql_query, mysql_fetch_assoc and so on.

3, the user does not filter input

  It should be: Never trust user input. With back-end PHP to verify the information each filter input, do not believe Javascript.

4, without the use of UTF-8

  UTF-8 solves many international issues. Although PHP6 to compare the perfect solution to this problem, but does not prevent you to the MySQL character set to UTF-8.

5, where the use of PHP with SQL

  If you are new to MySQL, sometimes when solving problems you might first consider using the familiar language to solve. This may cause some of the waste and poor performance situations. For example: when calculating the average NA AVG MySQL native () method, but with the PHP accumulation cycle all values and calculating the average over.

6, do not optimize queries

  99% of PHP database performance problems are caused by a bad SQL statement can make your whole program is very slow. MySQL's EXPLAIN statement, Query Profiler, many other tools of these tools can help you find those naughty SELECT.

7, using the wrong type of data

  MySQL provides a series of numbers, strings, and time data types. If you want to store date, it is to use DATE or DATETIME type, using plastic or string will make things more complicated.

8, used in the SELECT query *

  Do not use * to return all of the fields in the table, it will be very slow. You only need to remove the data fields you need. If you need to remove all of the fields, then you may need to change the table.

9, the index is less than or overindexing

  In general, the index should appear in the WHERE behind all the fields in the SELECT statement.

10, no backup

  Perhaps infrequent, but the database damage, hard drive is broken, service stop, and so on, these will cause catastrophic damage to data. So you must make sure that back up data automatically or save a copy.

 

Guess you like

Origin www.cnblogs.com/mokxjciw/p/11232479.html