php - Checking for non-null (or null) result set for Firebird with PHP5 -
so, haven't used firebird long, i'm writing search engine database have. there field required ask reason record changed if edit record reason. if user fails input reason, mark in table, keep track of all.
so, in search results, query second table, , i'm trying check non null (no 1 entered reason change) result set. however, i've tried using both ibase_query , ibase_fetch_row return results, , doesn't work expected.
i've been going off of php manual, , says should return true (for ibase_query) or false (for ibase_fetch_row) if result set has nothing.
http://php.net/manual/en/function.ibase-query.php http://php.net/manual/en/function.ibase-fetch-row.php
here code ibase_fetch_row:
$query3 = "select change_reason reason_for_changes id = $id"; $result3 = ibase_query($link, $query3); if (ibase_fetch_row($result3) != false) { $reasonchange = "<span style='color:red'>". "no reason given. <a href='changereason.php?id=$id'>add reason</a></span>"; } and ibase_query:
$query3 = "select change_reason reason_for_changes id = $id"; $result3 = ibase_query($link, $query3); if ($result3 == true) { $reasonchange = "<span style='color:red'>". "no reason given. <a href='changereason.php?id=$id'>add reason</a></span>"; } anyone have clue i'm doing wrong? seems returns 2 functions aren't documented.
Comments
Post a Comment