I am running into problem with a script.
We are having a database where a lot of people can log in order to upload article. They should also be able to read their own articles in order to make changes. But they shouldn't be able to read all the other articles.
Here is what I am trying to do. Each time somebody is logging into the system there will be an entry in the adminsession table.
I am trying to count the entries in the table and then filter the last session entry in order to work with the authorID in that particular entry.
Here is the code I have for this:
$numRows = mysql_num_rows(mysql_query("select pk_aId from tbl_AdminSessions "));
$aResult = mysql_query("select aWriterId from tbl_AdminLogins where alUserName = '$asUName[$numRows -1]'");
while ($aRow = mysql_fetch_array($aResult))
{
$id = $aRow["aWriterId"];
echo $id;
}
Thank you in advance
andrea