Display rest of BD mysqli data in new PHP window

Asked

Viewed 60 times

0

Well what I’d like to do is call the database data to be displayed only the main data in a table, and in that same table having the preview button where when I press it opens a window with the rest of the database information. The part of displaying the main information I’ve done, but I don’t know how to get it to open another window and display the rest of the information from that id.

This is the table that shows the BD information already with the button to open another window with the rest of the BD information:

Tabela de Exibição]

This is the part of the code that displays the information:

Codigo DA tabela

  • Place your code not images.

  • Ever tried to use target="_blank"in the </a> and in the href pass id via GET?

  • But you want to open a popup window or a new tab?

  • It would be more interesting to open a modal and pull the data via Ajax.

  • If you want help and an answer to your problem, instead of posting images post the code so we can copy, test and present a solution. Any questions please read this post https://pt.meta.stackoverflow.com/questions/5483/manual-de-como-n%C3%83o-fazer-perguntas/5485#5485

1 answer

1

You can open a new tab using <a target="_blank" ... passing the id through the url and recovering with $_GET:

<a href="detalhes.php?id=<?php echo $f["idEmulador"]; ?>" target="_blank">
    <button class="button">Expandir</button>
</a>

On the details page:

<?php 
$idEmulador = $_GET["id"];

//Realiza a busca pelo id e mostra ...

A design tip, in place of the button you can use a type icon:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<i class="material-icons">visibility</i>
<i class="material-icons">edit</i>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.