0
So guys, I’m starting now to learn how to mess with php and I’m trying to make a registration system whose will be registering in it activity. I’ve already got a lot of stuff, I was able to connect the bank, I was able to save data in phpmyadmin through a form. However, when I want to show the user the data recorded in a table on a web page, it does not show even the data being saved in the database. Can someone help me? I’ll be grateful ;-; `
<title>Sistema de Registro de Atividades</title>
</head>
<body>
<h1>Sistema de Registro de Atividades</h1>
<p><a href="form-add.php">Adicionar atividade</a></p>
<h2>Lista de atividades</h2>
<p>Total de de atividades: <?php echo $total ?></p>
<?php if ($total > 0): ?>
<table width="50%" border="1">
<thead>
<tr>
<th>Nome da Atividade</th>
<th>duracao</th>
<th>descricao</th>
</tr>
</thead>
<tbody>
<?php while ($user = $stmt->fetchall(PDO::FETCH_ASSOC)): ?>
<tr>
<td><?php echo $user['atividade_nome'] ?></td>
<td><?php echo $user['duracao'] ?></td>
<td><?php echo $user['descricao'] ?></td>
<td>
<a href="form-edit.php?id=<?php echo $user['id'] ?>">Editar</a>
<a href="delete.php?id=<?php echo $user['id'] ?>" onclick="return confirm('Tem certeza de que deseja remover esta atividade?');">Remover</a>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
<?php else: ?>
<p>Nenhum usuário registrado</p>
<?php endif; ?>
</body>
`
where are you doing the select in the database? you need this before calling the ->fetchall method, and where you are declaring the $stmt variable?
– tiagopaes