tailieunhanh - A Programmer’s Introduction to PHP 4.0 phần 7

Các dấu ngoặc vuông xung quanh phần kết luận của lệnh tổng quát có nghĩa là nó là tùy chọn. Ví dụ, nếu bạn muốn lấy tất cả các email của khách hàng từ bảng khách hàng, bạn có thể truy vấn cơ sở dữ liệu bằng cách sử dụng lệnh sau đây: | Chapter 11 Logical enough right This command could be generalized as follows SELECT column name FROM table name WHERE some condition The square brackets around the concluding part of the generalized command mean that it is optional. For example if you wanted to retrieve all of the customer emails from the customers table you could query the database using the following command SELECT cust_email FROM customers Moving onward assume that you wanted to insert a new row of data into the products table thus a new product since it is assumed that each product is unique . A sample insertion command is INSERT into products VALUES 1009pr Red Tomatoes Suppose that you later wanted to delete that data. A sample deletion command is DELETE FROM products WHERE prod_id 1009pr There are many SQL command variations a complete introduction of them certainly out of the scope of this book. Entire books are devoted to just this subject However I will attempt to keep the SQL commands throughout the remainder of this book relatively simple while at the same time attaining a certain level of practicality in the examples. I suggest searching the Web for several of the many SQL resources and primers. I have included a few of my personal favorites at the conclusion of this section. NOTE It is not required that you capitalize the SQL commands in a query. This is my personal preference done so as to more easily distinguish the query s various components. Given the fact that you are reading this book you are likely already wondering how a database is accessed from the Web environment. Typically some interfacing language such as PHP Java or Perl is used to initiate a connection with the database and then through the use of predefined functionality the database is queried as necessary. You can think of this interface language as the glue that melds the database and the Web together. With that said I turn my attention to my favorite glue language PHP. 262 Databases Additional Resources Here .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.