sorry,.. following on from this. I've got a similar problem and I just don't know enough about php and chronoConnectivity to work it out. i've done a bunch of searches which have kinda helped but i haven't found a topic where someone's trying to do the same thing.
i have two tables - one that holds details of job vacancies and another that has agency contact details. i'm trying to get a list of open jobs and use the 'contact' field in the jobs table to extract the 'phone' and 'email' fields from the agencyContact table.
the body code is:
<?php
$contact = JRequest::getString('{contact}', '', 'get'); // i should mention here, i tried without the { } around 'contact'
echo "contact: $contact <br />";
$db = "jos_chronoforms_agencyContact";
$query = "SELECT contact, phone, email FROM `$db` WHERE `contact` = $contact"; //i tried this without the backticks too.
echo $query;
$db->setQuery( $query );
$db->$query();
$email = $db->email;
$phone = $db->phone;
?>
<table style="text-align: left; width: 100%;" border=1 rules="cols" frame="box" cellpadding="2" cellspacing="3">
<tr>
<td style="width: 15%";>{title}</td>
<td style="width: 15%";>{contact}</td>
<td style="width: 15%";><?php echo $phone; ?></td>
<td style="width: 15%";><?php echo $email; ?></td>
</tr>
</table>
the result is:
contact:
SELECT contact, phone, email FROM `jos_chronoforms_agencyContact` WHERE `contact` =
Fatal error: Call to a member function setQuery() on a non-object in /share/MD0_DATA/Qweb/Joomla/components/com_chronoconnectivity/chronoconnectivity.html.php(176) : eval()'d code on line 7
it's probably something simple but i have no idea what.
i have a book on php programming that i borrowed from a mate and it says to use mysql_db_query() to send the query but i haven't seen a single example of that in this forum.
any help would be greatly appreciated.
thanks
Jason