1
dolphino
Custom block???
  • 2003/11/14 9:41

  • dolphino

  • Just popping in

  • Posts: 7

  • Since: 2003/11/12


Hello
I´m a newcomer at using XOOPS but I have a problem.The situation is: In a database I have a table xoops_data_kli which consist of information about clients.I always need to show all information that belongs to the client. The table consists of an item user_id which is the same as the user´s XOOPS login name...
Could you anyone help me please?

2
ackbarr
Re: Custom block???

...and you want to show this information for each client in a block? Set your custom block's content type to php and try something like this:

le="color: #000000"><?php global $xoopsUser, $xoopsDB; //Ensure the current viewer is logged in if ($xoopsUser) { //Setup SQL Query $sql = "SELECT * FROM " . $xoopsDB->prefix('data_kli') . " WHERE user_id = '" . $xoopsUser->getVar('uname') . "'"; //Send SQL Query to server $ret = $xoopsDB->query($sql); if ($ret) { while ($myarr = $xoopsDB->fetchArray($ret)) { //Output each record returned from the db //Variables are avialable like this: //$myarr['user_id'] } } else { //No records returned return false; } } else { //Current viewer is not logged in return false; }



3
dolphino
Re: Custom block???
  • 2003/11/15 11:38

  • dolphino

  • Just popping in

  • Posts: 7

  • Since: 2003/11/12



Yes, thnx

Login

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits