CenterForDigitalHumanities / DigiSig

DigiSig is a new resource for the study of sigillography, particularly medieval seals from the British Isles. It aims to foster sigillographic research by linking and matching sigillographic datasets and making that information available
http://www.digisig.org
1 stars 2 forks source link

Data Error: Descriptions always empty #29

Closed thehabes closed 9 years ago

thehabes commented 9 years ago

From E-mail with John:

Whatever change you made to the data recently seems be making all of your descriptions come back as an empty string. You will find the code in function.php. $column = $row->field_column; if ($exact == "e") { $search = "= '$term'"; } else { $search = "LIKE '%$term%'"; }

    $query5 = "SELECT DISTINCT $variables FROM search_view WHERE ($column $search)";

    if ($repository > 0) {
        $query5 = $query5 . " AND (fk_repository = '$repository')";
    }

    if ($catalogue > 0) {
        $query5 = $query5 . " AND (fk_catalogue = '$catalogue')";
    }  
    $query5 = $query5 . " ORDER BY $column";

    // the full search string applied
    $query5result = mysqli_query($link, $query5.$pagination_part);

while ($row = mysqli_fetch_array($query5result)) { ... $value2 = $row[1]; if($value2 == ""){ $value2 = "empty"; } It is always == "", which is why all the descriptions say empty. }

johnmcewan commented 9 years ago

The query is fine so we should leave that alone. The problem is the assignation of $value2.

thehabes commented 9 years ago

Here is what happens when I reassign value2. As you can see, the query does not return a consistent order of results anymore so changing the assignation of value2 still does not resolve the problem, since the order of results the query is returning differs from row to row, whereas before the result the query was returning was always in the same order.

search2

thehabes commented 9 years ago

Duplicate of issue #33, refer to this issue from now on