I'm getting there!
On a successful login I can extract all the data from the table
If say I logged in as one of the users how can I filter out the username from within the tabale?
"username" is the 2nd column within the table
<?php $username = $POST['username'];
$password = $POST['password'];
$self = $SERVER['PHP_SELF'];
$referer = $SERVER['HTTP_REFERER'];
if( ( !$username ) or ( !$password ) )
{ header( "Location:$referer" ); exit(); }
$conn = @mysql_connect( "localhost", "russellbcv", "passworm" )
or die ( "Could not connect" );
$rs = @mysql_select_db( "my_database", $conn )
or die( "Could not select database" );
$sql="select * from users where user_name=\"$username\"
and password = password( \"$password\" )";
$rs = mysql_query( $sql, $conn )
or die( "Could not execute query" );
$num = mysql_numrows( $rs );
if( $num != 0 )
$conn = @mysql_connect( "localhost", "russellbcv", "passworm" )
or die( "Could not connect" );
$rs = @mysql_select_db( "rates", $conn )
or die( "Could not select database" );
$sql = "select * from cdr";
$rs = mysql_query( $sql, $conn )
or die( "Could not execute query" );
$list = "<table border=\"1\" cellpadding=\"3\">";
$list .= "<tr><th>cli</th>";
$list .= "<th>username</th>";
$list .= "<th>date</th>";
$list .= "<th>time</th>";
$list .= "<th>number</th>";
$list .= "<th>destination</th>";
$list .= "<th>duration</th>";
$list .= "<th>cost</th></tr>";
while( $row = mysql_fetch_array( $rs ) )
{
$list .= "<tr>";
$list .= "<td>".$row["cli"]."</td>";
$list .= "<td>".$row["username"]."</td>";
$list .= "<td>".$row["date"]."</td>";
$list .= "<td>".$row["time"]."</td>";
$list .= "<td>".$row["number"]."</td>";
$list .= "<td>".$row["destination"]."</td>";
$list .= "<td>".$row["duration"]."</td>";
$list .= "<td>".$row["cost"]."</td>";
$list .= "</tr>";
}
$list .= "</table>";
echo( $list );
?> </body></html>