List database file and place a new line after a certain number

0

I've been trying to find a small solution for days:

Example:

I have this code:

//LISTAR AS PLAYLISTS
$dados_playlist = mysql_fetch_array(mysql_query("SELECT * FROM playlists where codigo = '".$_POST["playlists"]."'"));

At the time it is listed, I need to put 1 command (".$hora."".$minuto.") after a certain number that the user chooses.

Example:

Normal list:

1. Música 
2. Música 
3. Música 
4. Música 
5. Música 
6. Música

Now, an example of how I need to leave it after it is listed:

1. Música 
2. Música 
3. Música 
".$hora."".$minuto."
4. Música 
5. Música 
6. Música 
".$hora."".$minuto."

(in the case above the user selected: run every 3 songs right time)

After this, I'll save this list to a temporary file - > execute a cron so that ".$hora."".$minuto." is spoken in a player

    
asked by anonymous 29.07.2015 / 23:50

1 answer

0
$count = 1;
while( $row = mysql_fetch_array(mysql_query("SELECT * FROM playlists where codigo = '".$_POST["playlists"]."'")) )
{
    if( $count == $escolha_usuario1 )
    {
      echo "HORAMINUTO";
    }

    if( $count == $escolha_usuario2 )
    {
      echo "HORAMINUTO";
    }

    if( $count == $escolha_usuario3 )
    {
      echo "HORAMINUTO";
    }

    $count++;
}
    
30.07.2015 / 14:48