mypkgs works, but need an 'action' table

This commit is contained in:
eric 2004-06-26 13:21:04 +00:00
parent 5cbbf11c8b
commit dc3b13064c
4 changed files with 98 additions and 7 deletions

View file

@ -202,6 +202,26 @@ function account_from_sid($sid="") {
return $row[0];
}
# obtain the Users.ID if given their current SID
#
function uid_from_sid($sid="") {
if (!$sid) {
return "";
}
$dbh = db_connect();
$q = "SELECT Users.ID ";
$q.= "FROM Users, Sessions ";
$q.= "WHERE Users.ID = Sessions.UsersID ";
$q.= "AND Sessions.SessionID = '" . mysql_escape_string($sid) . "'";
$result = db_query($q, $dbh);
if (!$result) {
return 0;
}
$row = mysql_fetch_row($result);
return $row[0];
}
# connect to the database
#
function db_connect() {