Database

Creating the table

mysql> CREATE TABLE albums ( artist varchar(128), title varchar(128), year char(4), url varchar(128), id INT UNSIGNED NOT NULL AUTO_INCREMENT KEY ); mysql> describe albums; +--------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------+------------------+------+-----+---------+----------------+ | artist | varchar(128) | YES | | NULL | | | title | varchar(128) | YES | | NULL | | | year | char(4) | YES | | NULL | | | url | varchar(128) | YES | | NULL | | | id | int(10) unsigned | NO | PRI | NULL | auto_increment | +--------+------------------+------+-----+---------+----------------+ 5 rows in set (0.00 sec)

Inserting the data

mysql> insert into albums (artist, title, year, url) values ( 'Pink Floyd', 'The Dark Side Of The Moon', 1973, 'https://www.udiscovermusic.com/Pink_Floyd_-_Dark_Side_of_the_Moon.jpg' ); $query = sprintf ("INSERT INTO albums VALUES('%s', '%s', %d, '%s', NULL)", $artist, $title, $year, $url);