UPDATES VIA   RSS  |  Email Get updates via feedburner Get updates via twitter
Home / Coding / MySQL / PHP / Coding:How to fetch user pro…

Coding:How to fetch user profile data with SSI.php from a SMF forum database

Posted on 20. Jul, 2009 by Dragos in Coding, MySQL, PHP

Even though SMF offers a way to integrate their forum into any website, they do not provide enough information on how to do some basic tasks, e.g. fetching a member’s profile details from the database. Fortunately, Netbeans has a very helpful feature, the code Navigator which shows an instant preview of all functions available in an open file. So finding the function which does our job was pretty easy (though I couldn’t find it on SMF’s website).

Anyway, to fetch data from the SMF database, using SMF’s functions, we need to include SSI.php into our website.

include_once('path/to/your/forum/SSI.php'); // replace path/to/your/forum with your path to the SMF forum
$userData=ssi_fetchMember(1,''); //ssi_fetchMember() takes two parameters: first: the member id as an integer or more than one id passed in an array; second parameter: output method as string: 'echo' or '';
print_r($userData); //display the array containing the member's profile data
Translate this post
                    
                    

Related posts:

  1. PHP Error: Call to a member function fetch_assoc() on a non-object in
  2. PHP: How to get creation time of file with PHP on Linux machines
  3. WordPress: Easily Reset Your Account Password Using MySQL and PHP

blog comments powered by Disqus