Can the almighty boss help again?

Categories worked manually fine so far.
Now tried to manage them via ACP, and adding and updating is working.
But when editing or deleting a category its not doing what it should.
When editing the category name isn't displayed and the "allow userrooms" flag is always set to "no".
When deleting a category (it should be only possible if no rooms in this) it always show that there are no rooms in this cat.
It seems if the queries have no results, when using in MySQL or printing as echo-string they are working.
Here's the code about the categorys in sources/admin.php
} elseif(isset($_GET['deletec'])) {
// del cat
if(!isset($_GET['confirmc'])){
$body = "<div align=\"center\">$txt[637]<Br>
<a href=\"index.php?act=adminpanel&cp_page=rooms&deletec=$_GET[deletec]&confirmc=yes\">$txt[392]</a> |
<a href=\"index.php?act=adminpanel&cp_page=rooms\">$txt[393]</a>
</div>";
}
else {
$queryc = $db->DoQuery("SELECT COUNT(*) AS roomcount FROM {$prefix}rooms WHERE cat='$_GET[deletec]'");
if($queryc['roomcount'] == 0) {
echo "ok";
// delete cat
}
else {
echo "Not ok";
// delete rooms first
}
//$body = $txt[638]."<br><br><a href=\"index.php?act=adminpanel&cp_page=rooms\">$txt[77]</a>";
}
} elseif(isset($_GET['editc'])) {
// edit cat
$datac = $db->DoQuery("SELECT * FROM {$prefix}category WHERE id='$_GET[editc]'");
$cat_name = $datac['name'];
if($datac['allow_user'] == 1) {
$defy = " checked=\"true\"";
$defn = "";
}
else {
$defy = "";
$defn = " checked=\"true\"";
}
$body = "<Br>
<form action=\"index.php?act=adminpanel&cp_page=rooms&updatec=$cat_name\" method=\"post\">
<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td>Category Name:</td>
<td>$cat_name</td>
</tr>
<tr>
<td>$txt[634]</td>
<td><input type=\"radio\" name=\"allow_users\" value=\"1\"$defy>$txt[392] <input type=\"radio\" name=\"allow_users\" value=\"0\"$defn>$txt[393]</td>
</tr>
<tr>
<td colspan=\"2\"><div align=\"center\"><input type=\"submit\" value=\"$txt[187]\" class=\"button\"></div></td>
</tr>
</table></form><Br>";
} elseif(isset($_GET['updatec'])) {
Thanks.