tailieunhanh - PHP Developer's Dictionary- P11
PHP Developer's Dictionary- P11:PHP is an open source, server-side, HTML-embedded scripting language used to create dynamically generated Web pages. With an easy-to-use syntax and a large, extensible library of modules, PHP brings together the best of Perl, C++, and other languages. | PHP Developer s Dictionary pg_Close conn body html If the output of this script looks like this You have connected to the database successfully. then congratulations you have successfully connected to the test database. Select Insert Update and Delete Queries You will routinely perform four types of queries when using any type of database. The insert query will place items in the database the update query will update information that is already in the database the select query will display information in the database and the delete query will delete items from the database. When you query databases from inside PHP you will allocate memory when a database connection is made and when the result set is returned from your query. When your script is finished executing all memory will be freed but it is good programming practice to free the result by using the pg_FreeResult function and to close the connection by using the pg_Close function. Insert Queries We will use the following example to insert information into our newly created database. This example consists of two parts. The first part is a simple form that enables the user to input specific information to be added to the database. This form calls the PHP script that takes the form variables and then creates and executes the insert query. The HTML form looks like this html head title Insert Record title head body b Please provide us with the following b font p font size 2 face Arial Helvetica sans-serif form action method POST enablecab Yes Full Name Last First MI br input type Text name FullName align LEFT required Yes size 59 value br Address br input type Text name Address align LEFT required Yes size 59 value br City br input type Text name City align LEFT required Yes size 29 value br State br input type Text name State align LEFT required Yes IT-SC book 50 PHP Developer s Dictionary size 2 value br Zip br input type Text name Zip align LEFT required Yes size 10 value br Phone br input type Text .
đang nạp các trang xem trước