[head First Php&mysql] reading notes-what is PHP

Source: Internet
Author: User
Tags php script

PHP is a language that runs on the server. Why should have PHP, the server put static resources html,css,js,img These are not good?

But this alone is too monotonous. How to get a bit of interaction, instead of looking at static things every day, so only PHP.

The book is to start with a chestnut, simple to say is to submit the form to the background, the background to get data, and then run PHP script, put the data to insert into the database, want to use when the tune out.

Form submitted to the background, with $_get or $_post (according to form submitted by the method decision) through the table sole name is the name attribute, and then put the data in a variable inside, backstage.

You can use echo directly to the foreground output HTML, such as echo "

Like what

index.php, it could be these things.

<!doctype html>PHP     echo 123;? ></body>

The HTML part in the background unchanged, PHP to <?php?> inside the content run over, out of the HTML, and then the same output to the foreground.

Get the data back in the background and save it. Save it to the database, of course.

The basic operation of the database is also several.

1 Setting up a database

2 Selecting a Database

3 Creating a data sheet

4 Inserting data

5 Select data

Database and data table is the relationship between the set and the subset, no data table, all the data are thrown directly into the database to find Ah ...

1. Create database book;

2 use book;

3 CREATE TABLE Book1 (

Title varchar (30),

Author varchar (30),

Price varchar (30)

)

4 INSERT INTO Book1 (

Title,author,price

VALUES (' Good ', ' Mike ', ' $ ');

5 Select Title,author from Book1 or select * from Book1;

Of course, the fourth is to insert data into the data table, there is no front desk to come up with a data, we open the MySQL terminal inserted a piece of the. Trouble four, of course, to use PHP script.

How to use PHP script and MySQL interaction, hahaha haha, haven't seen. Read it and write it again.

[head First Php&mysql] reading notes-what is PHP

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.