I need to make a function that will make a button visible if a value in the ListingsDBElements is checked yes. I have been working on it, but where the code starts, it states there has been a problem, contact site admin. This is the code:
function renderPrintedCopy($listingID)
{
//
global $conn, $config;
$sql_listingID = make_db_extra_safe($listingID);
$sql = "SELECT " . $config[table_prefix] . "listingsDBElements.field_value, "
. $config[table_prefix] . "listingsFormElements.field_name FROM " . $config
[table_prefix] . "listingsDBElements, " . $config[table_prefix] .
"listingsFormElements WHERE ((" . $config[table_prefix] . "listingsDBElements
listing_id =$listingID) AND (" . $config
[table_prefix] . "listingsDBElements.field_name = " . $config[table_prefix] .
"listingsFormElements.field_name))";
$recordSet = $conn->Execute($sql);
if ($recordSet === false)
{
log_error($sql);
}
if ($recordSet->fields[field_name] == "printed") { $printed = $recordSet->
fields[field_value]; }
{
if ($printed == "Yes") {
echo "PINRT";}
else {
echo "";}
}// End Offer Printed Copies
?>
The value 'Yes' will be in the field 'printed' in the ListingDBElements. Don't know what other info I need to post! Thanks!!!