Hi folks
I desperately need some assistance for the following - this is for a custom profile field (and it is populated in the table )
Here is the PilotData.Class.php function:
public static function getFieldValue($pilotid, $title)
{
$sql = "SELECT f.fieldid, v.value
FROM ".TABLE_PREFIX."customfields f, ".TABLE_PREFIX."fieldvalues v
WHERE f.fieldid=v.fieldid
AND f.title='$title'
AND v.pilotid=$pilotid";
$res = DB::get_row($sql);
return $res->value;
}
In the layout.tpl file, I am trying to display the data as follows:
<strong>Pilot VID: </strong> <?php echo PilotData::getFieldValue($pilotid, 'IVAO'); ?>
I am getting nothing
I have also tried this code in the PilotData.class.php:
public function GetIvaoId($pilotid)
{
$query = "SELECT value FROM phpvms_fieldvalues WHERE pilotid='$pilotid'";
$res = DB::get_row($query);
echo DB::$error;
if($res) return $res->value;
else return 0;
}
Also with no success
I REALLY would aapreciate some assistance with the above. I know some php but am no fundi
I could be making a fundamental mistake here but am not sure
Thanks