May 2003
Intermediate to advanced
592 pages
14h 28m
English
The first scripts I’ll write will be for the purpose of adding products (specifically a print) to the database. The page will allow the administrator to select the artist by name or enter a new one, upload an image, and enter the details for the print. The image will be stored on the server and the print’s record inserted into the database. But since this will require a script that connects to the MySQL database, I’ll write that first.
1. | Create a new PHP document (Script 13.1).
<?php # Script 13.1 - mysql_connect.php |
2. | Define the database connection constants.
define ('DB_USER', 'username'); define ('DB_PASSWORD', 'password'); define ('DB_HOST', 'localhost'); define ('DB_NAME', 'ecommerce'); ... |
Read now
Unlock full access