Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<?php
@include 'config.php';
error_reporting (E_ALL ^ E_NOTICE);
?>
<!DOCTYPE html>
<html>
<head>
	<title>CRUD: CReate, Update, Delete PHP MySQL</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
	<table>
<thead>
<tr>
<th>Name</th>
<th>Password</th>
<th>Email</th>
<th>user_type</th>
<th colspan="2">Action</th>
</tr>
</thead>
<tbody>
    <?php while ($row = mysqli_fetch_array($resultAll)) { ?>
<tr>
  <td><?php echo $row['name'] ?></td>
  <td><?php echo $row['password'] ?></td>
  <td><?php echo $row['email'] ?></td>
  <td><?php echo $row['user_type'] ?></td>
<td>
<a href="#">Edit</a>
</td>
<td>
 <a href="#">Delete</a>
</td>
</tr>
  <?php } ?>      
    

</tbody>
 </table>

</body>
</html>


What I have tried:

i try to change ($result) to ($resultAll)
Posted
Comments
Chris Copeland 11-May-22 6:36am    
What code is present in the config.php file? Your page is trying to read the $resultAll variable for a MySQL query result but you've not actually defined that variable within that page. Where are you defining that variable?
Richard MacCutchan 11-May-22 6:47am    
You forgot to use an SQL query to get a set of results. As you can see, $resultAll is not defined anywhere in your code.
Richard Deeming 12-May-22 10:40am    
echo $row['password']

That line suggests you're storing your users' password in plain text. Don't do that!
Secure Password Authentication Explained Simply[^]
Salted Password Hashing - Doing it Right[^]

PHP even has built-in functions to help you do the right thing:
PHP: password_hash[^]
PHP: password_verify[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900