PHP Tutorial: Program script and Database function (i) _php tutorial

Source: Internet
Author: User
Tags php database
Fire Station College for programming enthusiasts to organize a number of articles, will be in the future of the article slowly provide to you, I hope you have some help, welcome to contribute! This article mainly tells the PHP script and the database detailed, altogether divides into three articles, today first tells first article:
In the current rapid development of the Internet, e-commerce sites in endless situation, the Web site development efficiency and quality has put forward more and more high requirements.
For large-scale and complex structure, the content of a wide range of sites, to achieve the dynamic and convenient site management. Data management is inseparable from database system support. And the important symbol of measuring a CGI language is its access to the background database, efficiency and so on.
And now the popular PHP scripting language, its new features give us a new feeling. It supports design development in an object-oriented manner. At the same time, in order to meet the unique needs of Web pages, with templates, XML support and so on to bring a new method of Web site development. In the language structure, PHP has a structure similar to the C + + language, and introduces the concept of classes, simplifying development.
PHP also has a strong database support capability. In this case, we will first introduce the general process of PHP access to the database, and then through the file database storage to introduce PHP access to the database of an advanced application. Finally, a practical and efficient database development method is introduced by using examples of database classes.

Introduction to PHP Database features
PHP provides support for more than 10 common databases, such as Oracle, DBase, Informix, SQL Server, Sysbase, MySQL, and more. It is because of extensive database support that it expands the scope of application of PHP so that various applications can be developed using PHP.
In various databases, MySQL has been widely used because of its free, cross-platform, easy to use and high access efficiency. Many central sites use Php+mysql as the best partner.
Oracle is a typical large database application system. Oracle is a good choice if you're designing a Web site with large data volumes, high performance and efficiency requirements.
On the WIN32 platform, SQL Server occupies a large market. PHP can access SQL Server.
PHP encapsulates the access methods of various databases, which are similar to the functions of different database systems, and increase the convenience of use.
Below, we will be a simple talent information exchange Center (see Figure 1) as an example, the program to achieve the online resume of the submission, browsing and other functions, to tell the whole process of PHP database operation. The database uses the most common MySQL database.
Basic Steps for PHP database operation
We will create a database named Resumedb on the local machine, which is known as the resume table in the database. The table stores the number of resumes, the name of the person, the profile, and the CV file in Word format.
1. Creation of the database
Switch to the/usr/local/mysql/bin directory, and at the command line, execute the following statement to create the database:
./mysqladmin-u Root-p Create Resumedb
Enter Password:
Enter the password after the prompt. If the database is used for the first time, the default password is empty and the direct carriage return is possible.
Then create a table that holds your CV.
Create a text file Resume.sql with the following content:
Use Resumedb;
CREATE TABLE Resume (
ID tinyint (4) not NULL auto_increment,
Name varchar (ten) is not NULL,
Intro varchar (255),
Resufile Longblob,
PRIMARY KEY (ID),
KEY ID (ID)
);
Place it under the My executable directory/usr/local/mysql/bin, and execute the following command:
./mysql-u Root-p〈resume.sql
Enter Password:
After entering the database password, the table resume is automatically created successfully. Among them, the Resufile field is the Longbolb type, used to store the binary Word document.
    • Total 2 Pages:
    • Previous page
    • 1
    • 2
    • Next page

http://www.bkjia.com/PHPjc/364163.html www.bkjia.com true http://www.bkjia.com/PHPjc/364163.html techarticle Fire Station College for programming enthusiasts to organize a number of articles, will be in the future of the article slowly provide to you, I hope you have some help, welcome to contribute! This article mainly tells ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.