I'm using data only from one table.
I have a need to format the field as in function formatLink example in documentation.
The difference is I need to format http link using output from mysql query from another table.
Here is what I did:
- Code: Select all
function link_ap($col,$val,$row)
{
if($row['ap_hostname'] != '')
{
include '/var/www/html/baza/reports/login.php';
$result_ip = mysql_query("select ip_address from core_wireless where ap_hostname='".$row['ap_hostname']."'");
return '<a href="https://'$result_ip'" target=_blank title="Otvori">'$result_ip'</a>';
}
else
{
return $val;
}
}
I get an error "[Tue Feb 03 12:46:26 2015] [error] [client 10.19.0.120] PHP Parse error: syntax error, unexpected T_VARIABLE in /var/www/html/baza/korisnici.php on line 120, referer: https://10.19.2.2/baza/index.php" in httpd error log.
Line 120 is this one:
- Code: Select all
return '<a href="https://'$result_ip'" target=_blank title="Otvori">'$result_ip'</a>';
Please help,
thank you