Jump to content
Sign in to follow this  
fil79

colocar o indice array em zero

Recommended Posts

fil79

Boas

tenho uma query em sql que é executada e depois listada através da função mysql_fetch_array. Acontece que no mesmo script quero listar novamente a mesma query e queria voltar a colocar o indice a zero para voltar listar do inicio. Desde já agradeço


MCITP-MCTS-MCP

Share this post


Link to post
Share on other sites
pmg

Em vez de

while ($row = read_database) {
  echo $row['coluna1'], $row['coluna2'];
}

experimenta

$data = array();
while ($row = read_database) {
  $data[] = $row;
}
/* ... */
foreach ($data as $row) {
  echo $row['coluna1'], $row['coluna2'];
}


What have you tried?

Não respondo a dúvidas por PM

A minha bola de cristal está para compor; deve ficar pronta para a semana.

Torna os teus tópicos mais atractivos e legíveis usando a tag CODE para colorir o código!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.