From: <pre...@us...> - 2002-09-30 02:34:38
|
Update of /cvsroot/webnotes/webnotes/core In directory usw-pr-cvs1:/tmp/cvs-serv8365/core Modified Files: user_api.php Log Message: added user_get_row function Index: user_api.php =================================================================== RCS file: /cvsroot/webnotes/webnotes/core/user_api.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- user_api.php 26 Sep 2002 12:29:30 -0000 1.10 +++ user_api.php 30 Sep 2002 02:34:34 -0000 1.11 @@ -94,7 +94,7 @@ return ("(cookie_string='$c_cookie')"); } ### -------------------- - # The parameter passed to this function is constructed via user_where_*(). + # The parameter passed to this function is constructed via user_where_*(). # $p_where is not cleaned, since it is assume that all the necessary escaping is # done in the function that constructed the where statement. function user_get_info( $p_where ) { @@ -133,6 +133,22 @@ } return $t_users_array; + } + ### -------------------- + function user_get_row( $p_user_id ) { + global $g_phpWN_user_table; + + $t_users_array = array(); + + $query = "SELECT * + FROM $g_phpWN_user_table + WHERE id='$p_user_id'"; + $result = db_query( $query ); + if ( !$result ) { + return false; + } + + return db_fetch_array( $result ); } ### -------------------- # $p_where is constructed using user_where_*(). |