Exemple #1
0
 function has_lookup_table($prop_id)
 {
     LookupTable::get_table_by_prop_id($prop_id, $table_name);
     if ($table_name) {
         return true;
     } else {
         return false;
     }
 }
Exemple #2
0
 function get_value_by_id($id, $prop_id)
 {
     LookupTable::get_table_by_prop_id($prop_id, $table_name);
     if (!$table_name) {
         die("error: LookupTable 232kdklwk33k3k4");
     }
     $lookuptable = new LookupTable($table_name);
     $sql = "SELECT " . $lookuptable->lookup_value_col . " FROM " . $lookuptable->tbl_name . " WHERE " . $lookuptable->prim_key_col . " = '" . $id . "'";
     $result = mysql_query($sql);
     if (!mysql_num_rows($result)) {
         die("Error: LookupTable {$table_name} - no value for id: {$id} ");
     }
     return mysql_result($result, 0, $this->lookup_value_col);
 }