PHP 5/MySQL Programming- P72

PHP 5/MySQL Programming- P72:computer programming has often been seen as a difficult and arcane skill. Programming languages are difficult and complicated, out of the typical person’s reach. However, the advent of the World Wide Web has changed that to some extent. It’s reasonably easy to build and post a Web page for the entire world to see. The language of the Web is reasonably simple, and numerous applications are available to assist in the preparation of static pages | 333 INSERT INTO adventure values 13 replace Enigma and wait You put the Enigma back in place and wait patiently but you never get another chance. You are discovered when the sub pulls in to harbor. 19 0 0 0 INSERT INTO adventure values 14 Win Congratulations You have captured the device and shortened the war 1 0 0 0 INSERT INTO adventure values 15 Water You are in the water. The sub moves away. It looks bad. 19 0 0 0 INSERT INTO adventure values 16 0 0 0 0 INSERT INTO adventure values 17 0 0 0 0 INSERT INTO adventure values 18 0 0 0 0 INSERT INTO adventure values 19 Game Over The game is over. You lose. 1 0 0 0 SELECT id name north east south west FROM adventure SELECT id description FROM adventure I wrote this code by hand but I could have designed it with phpMyAdmin just as easily. Note that I created the table inserted values and wrote a couple of SELECT statements to check the values. I like to have a script for creating a database even if I built it in a tool like phpMyAdmin because I managed to mess up this database several times as I was writing the code for this chapter. It is very handy to have a script that instantly rebuilds the database without any tears. Chapter 9 Using MySQL to Create Databases 334 Summary PHP 5 MySQL Programming for the Absolute Beginner Although you didn t write any PHP in this chapter you did learn how to create a basic data structure using the SQL language. You learned how to work with the MySQL console to create and use databases and how to return data from your database using the SELECT statement. You know how to modify the SELECT statement to get more-specific results. You know how phpMyAdmin can simplify the creation and manipulation of MySQL databases. You built a data structure for an adventure game. CHALLENGES 1. Design a database. Start with something simple like a phone list. 2. Create your database in SQL. 3. Write a batch program to create and populate your database. 4. Use phpMyAdmin to manipulate your database and .

Không thể tạo bản xem trước, hãy bấm tải xuống
66    3    1    21-03-2023
Đã 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.