Forums

PHP Function to format text in connection

momentis 24 Feb, 2015
I am trying to add a strikethrough on text in a connection list if a field in the row is set to a specific value. I have the following fields:

cust_names - Customer Name
cust_registered - Yes/No, showing if the customer has already registered

In my CC connection, I wish to show the customer name with a strikethrough if they have already registered (cust_registered = Yes). In the PHP Functions for the connection, I have the following:

cust.cust_names: return ($row['cust']['cust_registered'] == "No") ? '$row['cust']['cust_names']' : '<strike><b>".$row['cust']['cust_names']."</b></strike>');


Which is not working. Any idea what I am doing wrong?

Thanks!!
Rick
Max_admin 24 Feb, 2015
Answer
Hi Rick,

Please try this code:
cust.cust_names: return ($row['cust']['cust_registered'] == "No") ? $row['cust']['cust_names'] : '<strike><b>'.$row['cust']['cust_names'].'</b></strike>';


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
momentis 24 Feb, 2015
That did it. Thanks, Max!!!!

Rick
This topic is locked and no more replies can be posted.