From the documentation.
getIntTableRows($fields="*", $from="", $where="", $sort="", $dir="ASC", $limit="", $push=true)
// function to get rows from ANY internal database table
// This function works much the same as the getDocuments() function. The main differences are that it will accept a table name and can use a LIMIT clause.
// $fields = a comma delimited string: $fields="name,email,age"
// $from = name of the internal Etomite table which data will be selected from without database name or table prefix ($from="user_messages")
// $where = any optional WHERE clause: $where="parent=10 AND published=1 AND type='document'"
// $sort = field you wish to sort by: $sort="id"
// $dir = ASCending or DESCending sort order
// $limit = maximum results returned: $limit="3" or $limit="10,3"
// $push = ( true = [default] array_push results into a multi-demensional array | false = return MySQL resultset )
// Returns FALSE on failure.
Example usage
Here I have used it to query the internal table user_attributes, to return the name and phone number of the user.
If you use a prefix on your database, it is automatically added, so dont worry about prefixes. If however you have created your own table on the etomite database, it still counts as an internal table. Just make sure that your new table has the same prefix as the etomite tables. For instance if all the etomite tables start with etomite_ then make sure your new table does too, for getIntTableRows to work.
// returns the internalKey for the current session. Assumes logged in. $session = $_SESSION['internalKey']; // uses getIntTableRows to access the user attributes table from within the etomite install $userdetails = $etomite->getIntTableRows($fields="*", $from="user_attributes", $where="internalKey=$session", $sort="", $dir="ASC", $limit="1", $push=true); // output some fields from the table $output .= 'Your real name: '.$userdetails[0]['fullname']; $output .= 'Your phone: '.$userdetails[0]['phone']; return $output;
I have used the $fields="*" which returns all the fields. I have also set the $limit to return only one record. The row should be uniquely identified by my $where clause.
Paul.











