Sunday, January 20, 2013

Database Data Fetching using Db_query Codee

<?php 
global $user; 
$userid=$user->uid; 

$result = db_query('SELECT n.mett_score FROM {training_score} n WHERE n.uid = :uid', array(':uid' => $userid)); 

foreach ($result as $record) { 
echo 'Your Score is:'; print_r($record->mett_score); 
// or Aply This Code  
echo '<br/>' .'You Score Is:' .$record->mett_score; 
} 
?>

No comments:

Post a Comment