php in Body code with ccv5

mcasamassima 10 May, 2017
I have the following code in my connection view settings in body:
The if statement always return to the 'else', although {operatori_economici} = 2. What is wrong?

<?php

echo "<tr>";

if ('{operatori_economici.numero_incarichi}' > 0)
echo "<td bgcolor='red'> ".'{operatori_economici.numero_incarichi}'."</td>";
else {
echo "<td>".'{operatori_economici.numero_incarichi}'."</td>";
echo </tr>;
?>

I have read the post on this forum but did not solve my problem!
Max_admin 11 May, 2017
Answer
1 Likes
Hi mcasamassima,

You can't use the curly brackets syntax in PHP, you need to use the PHP format, I think the following code should work in v5:

if($row["operatori_economici"]["numero_incarichi"] > 0){
//code here
}


And its advised to use v6 for new connections.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.