Forums

Take var into CC to use in WHERE

buckwheatpie 08 Jul, 2009
hi,

I want to use a WHERE statement in ChronoConnectivity to define which record a user is shown, so that depending on which link the user clicks on, they will be shown a different record in the CC page.

so my WHERE statement in CC says something like WHERE cf_id=SelectedRecordNo

My problem is carrying that SelectedRecordNo variable into CC - I thought it would be easiest to define SelectedRecordNo in the URL, but i can't figure out how to do that - i tried adding &SelectedRecordNo=1 at the end of the URL, but i suppose it's wishful thinking to suppose it could be that straightforward... but this doesn't seem like it should be the sticky thing it has turned out to be....

Any help would be greatluy appreciated. Many thanks!
GreyHead 08 Jul, 2009
Hi buckwheatpie,

Adding it to the url is good, but then I think you have to get the value back from the $_GET array
<?php
$SelectedRecordNo = JRequest::getInt('SelectedRecordNo', 0, 'get');
echo "WHERE `cf_id` = $SelectedRecordNo";
?>

Bob
buckwheatpie 08 Jul, 2009
Works a treat.

Thank you 😀
This topic is locked and no more replies can be posted.