i need this so that a logged in user id is used and only that user can view his/her own data from a SQL query using PHP and not all data I can provide more info on request
(look for <<< )
<center>
<title>J~Net Balance Accounts</title>
<?php
// Connects to your Database
mysql_connect("localhost", "root", "password") or die(mysql_error());
mysql_select_db("messages") or die(mysql_error());
$data = mysql_query("SELECT * FROM users WHERE id=$id") <<<<
or die(mysql_error());
Print "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data ))
{
Print "<tr>";
Print "<th>User:</th> <td>".$info['user_name'] . "</td> ";
Print "<th>Balance:</th> <td>".$info['balance'] . " </td></tr>";
}
Print "</table>";
?>