How PHP and MySQL Work Together?

PHP provides the application part, and MySQL provides the database part of a Web database application. You use the PHP language to write the programs that perform the application tasks. PHP is flexible enough to perform all the tasks that your application requires. It can be used for simple tasks (such as displaying a Web page) or for complicated tasks (such as accepting and verifying data that a user typed into an HTML form). One of the tasks that your application must do is move data into and out of the database and PHP has built-in features to use when writing programs that move data into and out of a MySQL database.

PHP statements are embedded in your HTML files with PHP tags. When the task to be performed by the application requires storing or retrieving data, you use specific PHP statements designed to interact with a MySQL database. You use one PHP statement to connect to the correct database, telling PHP where the database is located, its name, and the password needed to connect to it. The database doesnt need to be on the same machine as your Web site;

PHP can communicate with a database acr across a network. You use another PHP statement to send instructions to MySQL. You send an SQL message across the connection, giving MySQL instructions for the task that you want done. MySQL returns a status message that shows whether it successfully performed the task. If there was a problem, it returns an error message. If your SQL message asked to retrieve some data, MySQL sends the data that you asked for, and PHP stores it in a temporary location where it is available to you.

You then use one or more PHP statements to complete the application task. For instance, you can use PHP statements to display data that you retrieved. Or you might use PHP statements to display a status message in the browser, informing the user that the data was saved.

As an RDBMS, MySQL can store very complex information. As a scripting language, PHP can perform very complicated manipulation of data, either data that you need to modify before saving it in the database or data that you retrieved from the database and need to modify before displaying or using it for another task. Together, PHP and MySQL can be used to build a Web database application that has a very sophisticated and complicated purpose.

How PHP Works?

PHP is an embedded scripting language when used in Web pages. This means that PHP code is embedded in HTML code. You use HTML tags to enclose the PHP language that you embed in your HTML file the same way that you would use other HTML tags. You create and edit Web pages containing PHP the same way that you create and edit regular HTML pages. The PHP software works in conjunction with the Web server. The Web server is the software that delivers Web pages to the world. When you type a URL into your Web browser, youe sending a message to the Web server at that URL, asking it to send you an HTML file. The Web server responds by sending the requested file. Your browser reads the HTML file and displays the Webpage. You also request the Web server to send you a file when you click a link in a Web page. In addition, the Web server processes a file when you click a Web page button that submits a form.

When PHP is installed, the W Web server is configured to expect certain file extensions to contain PHP language statements. Often the extension is .php or .phtml, but any extension can be used. When the Web server gets a request for a file with the designated extension, it sends the HTML statements as-is, but PHP statements are processed by the PHP software before they are sent to the requester. When PHP language statements are processed, only the output is sent by the Web server to the Web browser. The PHP language statements are not included in the output sent to the browser, so the PHP code is secure and transparent to the user. For instance, in this simple PHP statement:

<?php echo “<p>Hello World”; ?>

is the closing tag. echo is a PHP instruction that tells PHP to output the upcoming text. The PHP software processes the PHP statement and outputs this:

<p>Hello World

which is a regular HTML statement. This HTML statement is delivered to the user browser. The browser interprets the statement as HTML code and displays a Web page with one paragraph Hello World. The PHP statement is not delivered to the browser, so the user never sees any PHP statements.

PHP and the Web server must work closely together. PHP is not integrated with all Web servers, but it does work with many of the most popular Web servers. PHP is developed as a project of the Apache Software Foundation par consequently, it works best with Apache. PHP also works with Microsoft IIS/

PWS, iPlanet (formerly Netscape Enterprise Server), and others. Although PHP works with several Web servers, it works best with Apache. If you can select or influence the selection of the Web server used in your organization, select Apache. By itself, Apache is a good choice. It is free, opensource, stable, and popular. It currently powers over 60 percent of all Websites, according to the Web server survey at It runs on Windows, Linux, Mac OS, and most flavors of Unix.

What Is a Web Database Application?

An application is a program or a group of programs designed for use by an end user (for example, customers, members, circus acrobats, and so on). If the end user interacts with the application via a Web browser, the application is a Web-based or Web application. If the Web application requires the longterm storage of information, using a database, it is a Web database application. This book provides you with the information that you need to develop a Web database application that can be accessed with Web browsers such as Internet Explorer and Netscape.

A Web database application is designed to help a user accomplish a task. It can be a simple application that displays information in a browser window (for example, it displays current job openings when the user selects a job title) or a complicated program with extended functionality (for example, the book-ordering application at or the bidding application at eBay). Not surprisingly, a Web database application consists of a database and an application — just two pieces:

Database: The database is the long-term memory of your Web database application. The application can fulfill its purpose without the database. However, the database alone is not enough.

Application: The application piece is the program or group of programs that performs the tasks. Programs create the display that the user sees in the browser window; they make your application interactive by accepting and processing information that the user types in the browser window and they store information in the database and get information out of the database. (The database is useless unless you can move data in and out.)

The Web pages that you are previously created with HTML alone are static, meaning the user can interact with the Web page. All users see the same Web page. Dynamic Web pages, on the other hand, allow the user to interact with the Web page. Different users might see different Web pages. For instance, one user looking at a furniture store online product catalog might choose to view information about the sofas, whereas another user might choose to view information about coffee tables. To create dynamic Web pages, you must use another language in addition to HTML.

One language widely used to make Web pages dynamic is JavaScript. JavaScript is useful for several purposes, such as mouse-overs (for example, to highlight a navigation button when the user moves the mouse pointer over it) or accepting and validating information that users type into a Web form.

However, it not useful for interacting with a database. You wouldnt use JavaScript to move the information from the Web form into a database. PHP, however, is a language that is particularly well suited to interacting with databases. PHP can accept and validate the information that users type into a Web form and can also move the information into a database. The programs

in this book are written with PHP.

How to configure hyperlinks?

Links link one page to another page. They are essential if you site is composed of more than one page, or if you want to link to other sites on the Web. The example is an external link to a web site outside of this one. Showing the link in html code to design code.

Html code:

1) <a href="">Technomatic</a>
2) <a href="">Google</a>

Design code:

Example 1 = Technomatic

Example 2 = Google

Installation of Windows XP

1. System Requirements:

Check to insure that your system meets the minimum requirements for Windows XP:

2. Compatibility:

Check to insure that your hardware and software are compatible with the XP Operating System:

If you have not yet purchased the XP operating system, it may be a good idea to run the Windows XP Upgrade Advisor to check your software and hardware compatibility. It is a free download and could save you a lot of money in the event your software and hardware are not compatible. This is the same utility that comes bundled with the Windows XP Operating System CD and runs before it is installed.

3. Booting Options:

The Windows XP installation CD is bootable. If you are not able to configure your computer to boot from the CD-ROM, then it is possible that your system is not compatible.

4. Start the Installation:

Insert your Windows XP Installation CD.

If Windows automatically detects the Installation CD, you will soon be prompted with a "Press any key to boot from CD" message. You will have 5 seconds to hit any key. If you've delayed too long, your computer will continue to start from the hard disk.

Once you have pressed any key, files will begin to load from the installation CD. You will soon be asked what type of installation you wish to perform:

  • New Installation
  • Repair an existing installation

Since this tutorial teaches a clean installation, choose "New Installation".

You will then be prompted to agree to the End User License Agreement (EULA). You cannot continue without accepting. Press F8 to continue. Feel free to read the EULA if you want, but make sure you take breaks every hour or so.

The next screen will show the available partitions where you can install XP. Here you have the ability to create/delete partitions or just allocate the available space to one partition. If you choose to create multiple partition for whatever purpose, be sure to create them with sufficient size. I recommend partitions between 4-10 GB of size depending on what your plans are. If you plan to install a second Operating System, then an 8 to 10 GB partition would be best, but if your plans are merely to use a partition for backup purposes, then 4 to 6 GB may work fine.

Once your have chosen the partition you wish to install XP on, you will now need to format it to a file system. The choices are:

  • Fat32:

A new version of the file allocation table (FAT) available in Windows 95 OSR 2 and Windows 98. FAT32 increases the number of bits used to address clusters and also reduces the size of each cluster. The result is that it can support larger disks (up to 2 terabytes) and better storage efficiency (less slack space).

  • NTFS:

Short for New Technology File System, one of the file system for the Windows NT operating system (Windows NT also supports the FAT file system). NTFS has features to improve reliability, such as transaction logs to help recover from disk failures. To control access to files, you can set permissions for directories and/or individual files. NTFS files are not accessible from other operating such as DOS.

The most common file system for a single operating system installation is NTFS.

You will need to make a choice of the different formatting options. I recommend that you perform a FULL format of whichever file system that you've chosen. Once the format is complete, the installation will continue.

You will now see all of the files loading to your hard drive from the installation CD. Once the files are loaded, Windows will automatically reboot your system. When you are given the "Press any key to boot from CD" message, do not hit any key. Just let your system continue loading to your hard drive.

You will be prompted from time to time to enter in specific setup information such as:

  • Region and Language
  • Name and Organization
  • Product License Key
  • Date and Time
  • User Name and Password

Note: Be sure to write down and save your user name and password.

Eventually, Windows will reboot your system again. It will take you directly to the Windows Activation screen. You will be given the option to activate now or within a 30 day period. I recommend you take the time to activate your copy now. If you don't, you will be bothered by on-screen reminders.

Caution: Be sure to activate a firewall application or install SP2 from a disk prior to connecting to the Internet. Connecting a fresh XP installation that does not have any updates will be attacked by Spyware and Worms.

Congratulations! Your Windows XP Installation is complete! Enjoy.

5. Updates:

I have supplied the following links to aide you in locating any updates your installation may require:

How to disable/enable System Restore in Windows XP?

This information is for your convenience. System Restore is part of Windows XP. If you need help with System Restore, contact Microsoft technical support.

To disable System Restore, you must log on to Windows XP as Administrator. To see the System Restore tab, you must be logged on as Administrator. Below, you will find instructions that will help you determine if you are logged in as Administrator.

Note: If you turn off System Restore, you delete all previous restore points. You must create new restore points once you turn System Restore back on.

To turn off Windows XP System Restore

  1. Click the Start button.
  2. Right-click My Computer, and then click Properties.
  3. On the System Restore tab, check Turn off System Restore or Turn off System Restore on all drives
  4. Click Apply. The following message appears:
  5. This deletes all existing restore points. Click Yes to do this.
  6. Click OK.
  7. Proceed with what you need to do. For example, removing viruses. Restart the computer and follow the instructions in the next section to turn on System Restore.

To turn on Windows XP System Restore

  1. Follow the steps in the previous section, but in step 3, uncheck Turn off System Restore or Turn off System Restore on all drives. Then click OK.
  2. Create new System Restore points.

How to connect printer to wireless network?


I have wireless router for a local network. How can I connect my printer into this wireless network?


What you will need is a wireless print server. Both of the listed products should work fine:

Linksys WPS11


D-Link DP-311P

Note: If you are using anAll-In-One product (printer,scanner,fax), the print servers typically only support the print function.

What is Access Point?

Wireless Access Point (WPA)

Wireless LAN transmitter/receiver that acts as a connection between wireless clients and wired networks. Many WAPs (wireless access point) can be connected together to create a larger network that allows "roaming" without losing their connection, which is similar to a cellular phone.

How to Install the Windows 98 Operating System

In this article I will teach you to install Windows 98 First or Second Edition on a computer with a formatted or even unformatted hard drive!


1. Windows 98 CD
2. Computer with CD-ROM Access

Configuring your BIOS for the Install:

To find out how to access the BIOS please refer to your motherboard manual or the manufacturer of your computer. (The system BIOS can usually be entered on boot, usually by pressing the F1, F2, F8, F10 or DEL key. Make sure you save the settings before exiting.
If you are unsure or don't want to enter the BIOS then just test the computer by putting the CD-ROM in the drive and rebooting the computer. This is the recommended way to install Windows 98.


  1. Insert the Windows CD and restart your PC.
  2. Once the Windows 98 Setup Menu comes up choose option #2 (Boot from CD-ROM)
  3. Then the Windows 98 Startup Menu will come up. Select Option #1. (Start Windows 98 Setup from CD-ROM)
  4. Now your computer will install some drivers so please wait for a few moments.
  5. Now a blue setup screen will come up. Press Enter.
  6. Setup then wants to do some system tests. Just press Enter.
  7. Scandisk will now run, please wait.
  8. After ScanDisk completes, Windows will copy a few important files for setup.
  9. Now the graphical Windows 98 Setup Screen will come up.
  10. Click Continue and wait for the setup wizard to complete.
  11. Now it will ask you in which directory to install Windows too. The default directory is just fine so click Next.
  12. Setup will now prepare the directory, please wait.
  13. Setup will now check for installed components and disk space, please wait.
  14. Setup will now prompt you to choose the type of installation. Choose Typical if you have a desktop computer or Portable if it is a laptop.
  15. Windows will prompt you to install components, just choose Continue.
  16. If a network card is detected a network information screen will appear. Type in the required information and click Next
  17. Select your country settings, United States should be chosen by default.
  18. Now finally the main part of Setup is here. Setup will start copying files. This could take some time, please be patient.
  19. Once setup is done copying files, Windows will restart automatically.
  20. The Windows 98 Startup Menu will now appear. Select option #1 (Boot from Hard Disk)
  21. The Windows 98 booting screen will appear!
  22. Now Windows will prompt you for user information, enter it and click Continue.
  23. Now the License Agreement. Read it and if you agree click on "I accept the Agreement" and click Next. If you select "I don't accept the Agreement" then setup will end.
  24. Now input your product key or certificate authenticity code. This is 16 digits and is located on the back of your CD case or on the Windows 98 Book. If you have an OEM computer then it could be on the side or back of your computer. Click Next to continue.
  25. Click Finish.
  26. Setup will now finalize the hardware and install settings.
  27. Setup will now install plug and play devices.
  28. Your computer will restart automatically.
  29. The Windows 98 Startup Menu will appear. Select option #1 (Boot from Hard Disk)
  30. Windows will start booting for the second time.
  31. Setup will continue installing hardware.
  32. Now setup will prompt you to enter in your time, date, and time zone. Once selected click on Apply and then OK.
  33. Windows will continue to setup Windows items.
  34. The computer will restart automatically once again.
  35. The Windows 98 Startup Menu will appear. Select option #1 (Boot from Hard Disk)
  36. Windows will boot for the third time.
  37. Windows will update system settings.
  38. Now finally you have reached the Windows Desktop!
  39. You also may need to install your hardware drivers. If everything is working properly then you shouldn’t worry about them.

Enjoy your new freshly installed Windows 98 computer and good luck!