mysql_fetch_assoc() and echo

Hello,
I would like to view items in a block Dolphin ($res = mysql_fetch_assoc ($ req))
I want to display multiple items
but now, Dolphin gets a single element (in place of 10)
if I echo $row ['ID'];
this works, but not in my block.

my question is how to display my results in my bloc please
sorry for the bad translation

Bonjour,

je souhaiterais faire afficher des éléments dans un bloc Dolphin   ($res = mysql_fetch_assoc($req))

j'aimerais afficher plusieurs éléments 

mais voilà, Dolphin me retourne un seul élément (au lieux de 10)

si je fais echo  $row['ID'];

ceci fonctionne, mais pas dans mon bloc.

 

ma question est comment afficher mes résultats dans mon bloc SVP

 

en vous remerciant beaucoup pour votre aide  

Quote · 13 Nov 2011

Not sure how your code is, but maybe this can help you....
if not...you have to post some code here to show what you try to do

while ($row = mysql_fetch_assoc($result)) {
    echo $row["userid"];
    echo $row["fullname"];
    echo $row["userstatus"];
}

Quote · 13 Nov 2011

Thank you for answered ... Wink

the code is ok with "echo" the problem is here

capture

 

function get_historique() {

 

 

$sQuery = "SELECT * FROM user_valeur_historique_system WHERE last_id = '{$iID}' 

ORDER BY date_transaction LIMIT 10";

 

 

 

 

 


if(!$sQuery)

           

 

        $rResult = $this->res($sQuery);

        

 

if($rResult) {

while($aRow = mysql_fetch_array($rResult))

echo $aRow[ID_ACHETEUR].'a acheter '.$aRow[ID_client];

 

 

mysql_free_result($rResult);

}

return $aResult;

}

If I remove the "echo"
I have only one display results in html block  in Dolphin

I know what to do ..

again sorry for the translation

Quote · 14 Nov 2011

where shall this code be visible, home page?

Quote · 15 Nov 2011

Hello Okweb

in profile (included profile.inc.php)

Quote · 15 Nov 2011

You can try this,

1) Admin/Builders/Pages Builder => Profile, Add a new HTML block as bellow:

Caption Lang Key: Historique
Visible for: Guest Member

SAVE


2) Open phpMyAdmin, click on table sys_page_compose and browse
look at row Caption and find Historique (shall be the last insert id)
Edit ID where Caption = Historique as bellow:

Page: profile
Desc: Historique block
Func: Historique
Content:

SAVE

(Content shall be blank)


4) Open file templates/base/scripts/BxBaseProfileView.php

Find function getBlockCode_Description() and add this code above

/**
* get historique block
*/
 function getBlockCode_Historique() {
  global $site;
  global $getBlockCode_Historique_db_num;
  global $oTemplConfig;
 
  $Historique_num = '10';

  if ( $Historique_num )
  {
  $Historique_res = db_res( "SELECT `ID`, `NickName`
                       FROM `Profiles`
                       WHERE `Status` = 'Active'
                       LIMIT $Historique_num" );

         $ret .= '<div class="clear_both"></div>';
 
   if( mysql_num_rows( $Historique_res ) > 0 )
   {
    $j=1;
    while( $Historique_arr = mysql_fetch_assoc( $Historique_res ) )
    {

     $ret .= '<div class="boxContent">';
     $ret .= process_line_output( $Historique_arr['ID'] );
     $ret .= ' a acheter ';
     $ret .= process_line_output( $Historique_arr['NickName'] );
     $ret .= '<br />';
     $ret .= '</div>';
   
     $j++;
    }
   }
   else
   {
    $ret .= '<div class="no_result">';
     $ret .= '<div>';
      $ret .= _t("_No results found");
     $ret .= '</div>';
    $ret .= '</div>';
   }
   $ret .= '<div class="clear_both"></div>';
  }
 
  return $ret;
 }


5) That's all,
all you need to do now is edit sql query and the variables you will show to suit your needs...

Hope it will help you....

Quote · 15 Nov 2011

Perfect! thank you Okweb !

this code works properly for meSmile
I do not know how to thank youWink

Quote · 16 Nov 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.