skip to Main Content

audio table
1.id
2.artist
3.filename
4.album
5.release
6.audio URL
7.no download
8.no played
9.producer
10.studio,

video table
1.id
2.artist
3.filename
4.album
5.release
6.video URL
7.no download
8.no played
9.producer
10.studio

album table
1.id
2.album pic
3.title
4.album name
5.release
6.audio URL
7.video URL

2

Answers


  1. You can use a query like this in SQL or MySQL:

    UPDATE `audio_table`
    SET `num_download` = `num_download` + 1
    WHERE `id` = 1234
    

    If you’re only doing it in PHP, then you would lose info on restart or crash (unless you saved it to a file), but the database method is faster.

    Login or Signup to reply.
  2. Your statement does not explain in which step you are having problems with. The general procedure should be:

    1. record with PHP when a download was made (i.e Ajax-Request)

    2. connect PHP to the database, there are two ways to do this, either
      use the PHP Database Object (PDO) or MySQL Improved extension

    3. verify if the connection to the database is established

    4. execute an SQL command in PHP to update the respective row of a table

    To help you better, you must explain exactly which of the four steps you have problems with.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search