Selecting certain records with a where statement

DINAWebMan 11 Mar, 2014
I have a list of businesses with company name and category ID fields. I can list all businesses in alphabetical order.

I want to select certain businesses based upon their business category. I attempted to use the Conditions box under models: return array("CategoryID" => "3");

I saw a reference to the "where box" in another post, however, I have not been able to find a box with that label.
GreyHead 11 Mar, 2014
Hi DINAWebMan,

It is the Conditions* box you need, the array looks OK to me provided that the column name is CategoryID. If you turn the CC Debugger on what do you see?

Bob

* CCv4 called it the WHERE box - I have no idea why it has changed :-(
DINAWebMan 11 Mar, 2014
I did not realize I had to place it inside PHP markers:
<?php return array("CategoryID" => "3"); ?>

Never quite sure when PHP is understood and when it has to be stated.
GreyHead 11 Mar, 2014
Hi DINAWebMan,

The default in ChronoForms and ChronoConnectivity is that you need to add the <?php ?> tags. Always the best starting assumption.

Bob
DINAWebMan 11 Mar, 2014
Can you use a variable in the print statement? I'm trying to write a conditional statement that prints the field if the field is not empty.
?php 
	if($RepFirstname !='')
	print "$RepFirstname $RepLastname<br />";	 
?>

When I enter this is the body code area of Front List -> List Display it does not print.
GreyHead 26 Mar, 2014
Hi DINAWebMan,

Yes you can use pretty much any PHP you like.

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