Home Database Mysql Tutorial Mysql入门系列:PHP脚本的特点_MySQL

Mysql入门系列:PHP脚本的特点_MySQL

Jun 01, 2016 pm 01:56 PM
dynamic how Embedded

  PHP 是一种脚本语言,可以编写包含嵌入式代码的Web 页面,只要访问页面就能执行这些代码,并且这些代码还能生成动态的内容作为输出的一部分发送到客户机的Web 浏览器。本章描述了如何用PHP编写使用MySQL的基于We b的应用程序。有关C 与PHP 和Perl DBI API 的比较,请参阅第5章“MySQL程序设计介绍”。

  本章的实例利用了样例数据库samp_db,这个实例使用了为学分保存方案而创建的表和第1章“MySQL和SQL 介绍”中为历史同盟而创建的表。虽然在写本书时PHP 4还处于?测试阶段,而当您读到本书时它可能已经发布了,但这里还是要涉及PHP 3的内容。与PHP 3兼容是PHP 4 的一个明确设计目标,因此这里所说的有关PHP 3的各个方面都可应用到PHP 4中。从PHP 3 更改到PHP 4 有一组移植注意事项。如果使用PHP 4,就应该阅读那些注释。

  本章假设的环境是:PHP 与Apache Server结合使用。必须安装MySQLC 客户机库和头文件,因为建立PHP 时需要这些文件,否则PHP 不知道如何访问MySQL数据库。如果需要获得一些这样的软件,请参阅附录A“获得和安装软件”。附录中还给出了获得本章开发的实例脚本的说明,您可以直接下载这些脚本。

  在UNIX 环境下,PHP 或者作为内建模块用于Apache,该模块连接到Apache 可执行的二进制程序上;或者作为独立的用于传统CGI 程序的解释程序。在Windows 环境下,虽然开发在Windows NT 环境下运行的Apache PHP 4 模块的工作正在进行之中,但是此刻的PHP只能作为一个独立程序来运行。

  本章的大部分篇幅,都用来说明了在这里讨论所需要的PHP 函数。要想较全面地了解所有关于MySQL的函数,请参阅附录H“PHP API 参考”,也可以查阅PHP 手册,它描述了PHP 提供的全部函数,包括使用除MySQL以外的数据库的函数(使用MySQL时,PHP不受限制的部分仅仅只有DBI)。这个手册可以从PHP Web 站点下载: http://www.php.net/。该Web 站点也有从PHP 3移植到PHP 4的注意事项。

  PHP 脚本的文件名带有扩展名,该扩展名允许Web 服务器识别文件名并执行PHP 解释程序去处理它们。如果使用了不可识别的扩展名,则PHP 脚本被当作纯文本。本章使用的扩展名为. p h p,其他通用的扩展名为.php3 和. p h t m l。有关配置Apache 来识别扩展名的说明,请参阅附录A。在机器上,如果没有掌握Apache 的安装,那么需要与系统管理员一起检查,找出可使用的适当扩展名。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1270
29
C# Tutorial
1250
24
Fix: Windows 11's dynamic refresh rate doesn't work Fix: Windows 11's dynamic refresh rate doesn't work Apr 13, 2023 pm 08:52 PM

You can measure a screen's refresh rate by counting the number of times the image updates per second. DRR is a new feature included in Windows 11 that helps you save battery life while still providing a smoother display, but it's no surprise when it doesn't work properly. Screens with higher refresh rates are expected to become more common as more manufacturers announce plans to stop producing 60Hz monitors. This will result in smoother scrolling and better gaming, but it will come at the cost of reduced battery life. However, the dynamic refresh rate feature in this iteration of the OS is a nifty addition that can have a big impact on your overall experience. Read on as we discuss what to do if Windows 11’s dynamic refresh rate isn’t working

How to Hide Dynamic Island and Red Indicator in iPhone Screen Recording How to Hide Dynamic Island and Red Indicator in iPhone Screen Recording Apr 13, 2023 am 09:13 AM

On iPhone, Apple's screen recording feature records a video of what you're doing on the screen, which is useful if you want to capture gameplay, walk someone through a tutorial in an app, demonstrate a bug, or anything else. On older iPhones that have a notch at the top of the display, the notch is not visible in screen recording, as it should be. But on newer iPhones with the ‌Dynamic Island‌ cutout, such as the ‌iPhone 14 Pro‌ and ‌iPhone 14 Pro‌ Max, the ‌Dynamic Island‌ animation displays the red recording indicator, which causes the cutout to be visible in captured videos. this might

Convert VirtualBox fixed disk to dynamic disk and vice versa Convert VirtualBox fixed disk to dynamic disk and vice versa Mar 25, 2024 am 09:36 AM

When creating a virtual machine, you will be asked to select a disk type, you can select fixed disk or dynamic disk. What if you choose fixed disks and later realize you need dynamic disks, or vice versa? Good! You can convert one to the other. In this post, we will see how to convert VirtualBox fixed disk to dynamic disk and vice versa. A dynamic disk is a virtual hard disk that initially has a small size and grows in size as you store data in the virtual machine. Dynamic disks are very efficient at saving storage space because they only take up as much host storage space as needed. However, as disk capacity expands, your computer's performance may be slightly affected. Fixed disks and dynamic disks are commonly used in virtual machines

How to convert dynamic disk to basic disk on Windows 11 How to convert dynamic disk to basic disk on Windows 11 Sep 23, 2023 pm 11:33 PM

If you want to convert a dynamic disk to a basic disk in Windows 11, you should create a backup first as the process will erase all data in it. Why should you convert dynamic disk to basic disk in Windows 11? According to Microsoft, dynamic disks have been deprecated from Windows and their use is no longer recommended. Additionally, Windows Home Edition does not support dynamic disks, so you will not be able to access these logical drives. If you want to combine more disks into a larger volume, it is recommended to use Basic Disks or Storage Spaces. In this article, we will show you how to convert dynamic disk to basic disk on Windows 11 How to convert dynamic disk to basic disk in Windows 11? In the beginning

How to Get Live Tiles on the Desktop and Start Menu in Windows 11 How to Get Live Tiles on the Desktop and Start Menu in Windows 11 Apr 14, 2023 pm 05:07 PM

Imagine you are looking for something on your system but are not sure which application to open or select. This is where the Live Tiles feature comes into play. A live tile for any supported application can be added to the desktop or Windows system's Start menu, with its tiles changing frequently. LiveTiles make application widgets come alive in a very pleasing way. Not just for its appearance, but even for convenience. Suppose you are using whatsapp or facebook application on your system, wouldn't it be convenient if the number of notifications is displayed on the application icon? This is possible if any such supported app is added as a live tile. Let’s see how to do it in Windows

How to disable dynamic display of folders and files to prevent quick access in Windows 10 and 11? How to disable dynamic display of folders and files to prevent quick access in Windows 10 and 11? May 06, 2023 pm 04:58 PM

Microsoft introduced Quick Access in Windows 10 and retained the feature in the recently released Windows 11 operating system. Quick Access replaces the Favorites system in File Explorer. One of the core differences between the two features is that Quick Access adds a dynamic component to its list. Some folders appear permanently, while others appear based on usage. Fixed folders are displayed with a pin icon, while dynamic folders do not have such an icon. You can see a comparison between My Favorites and Quick Access here for more details. Quick Access is more powerful than Favorites, but dynamic folder lists add an element of clutter to it. Files that are useless or should not be highlighted in File Explorer may be displayed

How to use Dynamic Lock on Windows 11 How to use Dynamic Lock on Windows 11 Apr 13, 2023 pm 08:31 PM

What is dynamic locking on Windows 11? Dynamic Lock is a Windows 11 feature that locks your computer when a connected Bluetooth device (your phone or wearable) goes out of range. The Dynamic Lock feature automatically locks your PC even if you forget to use the Windows Key + L shortcut while walking away. Dynamic Lock works with any connected device with Bluetooth, but it's best to use a device with enough battery power and range, such as your phone. Once your device becomes inaccessible for 30 seconds, Windows will automatically lock the screen. Pair a Bluetooth device with Windows 11 For everything to work properly, you need to first

Which one has better prospects, Java or embedded? Which one has better prospects, Java or embedded? Oct 24, 2023 am 09:32 AM

Java and embedded systems are both very important technical directions in the computer field, and they each have different application scenarios and development prospects. Below I will analyze the prospects of Java and embedded systems from the aspects of job market, technology development, industry needs and development trends.

See all articles