PHP Tutorial: detailed description of program scripts and database functions (1) _ PHP Tutorial

Source: Internet
Author: User
Tags php database
PHP Tutorial: detailed description of program scripts and database functions (1 ). The Institute of fire station has compiled some articles for programmers, which will be provided to you in future articles. I hope to help you. thank you for your contribution! This article mainly describes some articles prepared by the Institute of fire station for programmers, which will be provided to you in future articles. I hope to help you. thank you for your contribution! This article describes the PHP script and database in detail. it consists of three parts. let's talk about the first article today:
With the rapid development of the Internet and the endless emergence of e-commerce websites, website development efficiency and quality are increasingly demanding.
For large websites with complex structures and rich content, dynamic and convenient website management must be implemented. Data management is inseparable from the support of the database system. An important indicator of a CGI language is its access capability and efficiency to the background database.
The popular PHP scripting language, its new features, brings us a new feeling. It supports design and development in an object-oriented manner. At the same time, in order to meet the unique needs of web pages, templates and XML support have brought new methods for website development. In terms of language structure, PHP has a structure similar to the C ++ language, introduces the concept of classes, and simplifies development.
PHP also has powerful database support capabilities. Here we will introduce the general process of accessing the database through PHP through an example, and then introduce an advanced application of accessing the database through PHP through the file database storage. Finally, we will introduce practical and efficient database development methods through Database-type use instances.

PHP database features
PHP supports more than 10 common databases, such as Oracle, dBase, Informix, SQL Server, Sysbase, and MySQL. It is precisely because of extensive database support that PHP applications can be expanded and various applications can be developed using PHP.
Among various databases, MySQL is widely used because it is free, cross-platform, easy to use, and highly efficient to access. Many central websites use PHP + MySQL as the best partner.
Oracle is a typical large-scale database application system. If you design a website with a large data volume and high performance and efficiency requirements, Oracle is a good choice.
On the Win32 Platform, SQL Server occupies a large market. PHP can access SQL Server.
PHP encapsulates access methods for various databases, and functions for different database systems are similar, increasing ease of use.
Next, we will use a simple talent Information Exchange Center (see) as an example to program online submission, browsing, and other features of my resume, and describe the entire PHP database operation process. The database uses the most commonly used MySQL database.
PHP database operation steps
We will create a database named ResumeDB on the local machine. The database contains a table named Resume. The numbers, names, profiles, and Word-format resumes are stored in the table.
1. create a database
Switch to the/usr/local/mysql/bin directory, and run the following statement on the command line to create a database:
./Mysqladmin-u root-p create ResumeDB
Enter password:
Enter the password after the prompt. If the database is used for the first time and the default password is blank, press enter.
Create a table to save your resume.
Create a text file Resume. SQL with the following content:
Use ResumeDB;
Create table Resume (
ID tinyint (4) not null auto_increment,
Name varchar (10) not null,
Intro varchar (255 ),
ResuFile longblob,
Primary key (ID ),
Key id (ID)
);
Put it in My executable directory/usr/local/mysql/bin and execute the following command:
./Mysql-u root-p <Resume. SQL
Enter password:
After you enter the database password, the table Resume is automatically created. The ResuFile field is longbolb type, which is used to store binary word documents.
  • 2 pages in total:
  • Previous Page
  • 1
  • 2
  • Next page

Success! This article mainly describes...

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.