Jump to content

How can i pull data from database?


Recommended Posts

Hello,
 
I have bought a product review with facebook login module and i am trying to pull "facebook user id" from database. I will use this value to show their profile photo near their name. But somehow i can not pull the "facebook user id" value from database. Can you please help me, Am i missing something?
 
in class/reviewhelp.class.php
 
public function getUserPhoto($data=null){

   $id_customer = (int) $data['id_customer'];
   //get info about fb id
   $result2 = Db::getInstance()->GetRow('
      SELECT * FROM `'._DB_PREFIX_.'fb_customer` 
      WHERE `customer_id` = '.$id_customer.'
   ');

   if($result2){
      $fbuserid = $result2['fb_id'];
   } else {
      $fbuserid = "nofacebook";
   }

   return $fbuserid;
}
 
In productreviewfb.php
 
$smarty->assign(array($this->name.'fbuserid' => $fbuserid));
 
 
In review.tpl
{$fbuserid}
{if isset($fbuserid)}exist{else}not exist{/if}

Sadly output is always "not exist" and does not show the value of $fbuserid :(

Where i am doing wrong?

Edited by ajnglagla (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...