PHP code if within Body chronoconnectivity

mccane 28 Jun, 2009
I have the following code in my connection view settings in body:
The if statement always return to the 'else', although $isCategorie = "categorie". What is wrong?

<?php

echo "<tr>";
$isCategorie = '{eigenschap}';
$categorieNaam = '{waarde}';

if ($isCategorie == "categorie") {
echo $categorieNaam . "<br>";
}
else {

echo "<td>".'{eigenschap}'."</td>
<td>{waarde}</td></tr>";
}
?>
Max_admin 30 Jun, 2009
Hi,

This is because the PHP runs before the {field_name} replace is done, so your code should be:


<?php

echo "<tr>";
$isCategorie = $MyRow->eigenschap;
$categorieNaam = '{waarde}';

if ($isCategorie == "categorie") {
echo $categorieNaam . "<br>";
}
else {

echo "<td>".'{eigenschap}'."</td>
<td>{waarde}</td></tr>";
}
?>

if you want it to run the way you want!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mccane 30 Jun, 2009
Thank you
That works (of course)

:-)
inocampo 25 Oct, 2013
$MyRow-> Not work
Max_admin 07 Nov, 2013
Hi,

If you are using the latest V4 then you should use
$row['field_name']
or
$row['MODEL_ID']['field_name']


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.