Hola gracias por las respuestas, ya pude solucionar el problema tuve que cambiar algunas cosas pero finalmente aquí esta el código por si a alguien le sirve:
Código PHP:
Ver original<?php
require("conexion.php");
require("funciones.php");
$criterio = getParam($_GET["criterio"], "");
$total = 0;
if ($criterio != "") {
$query = "SELECT sucursales.nombre_sucursal, opsucursales.depositos, opsucursales.retiros,(@opsucursales.total:[email protected] + opsucursales.depositos - opsucursales.retiros + opsucursales.balance_inicial)balance FROM opsucursales, sucursales JOIN (SELECT @opsucursales.total:=0) t1 WHERE sucursales.id=opsucursales.sucursale_id and sucursales.nombre_sucursal like ".sqlValue($criterio."%", "text")."";
$query2 = "SELECT nombre_sucursal, id FROM sucursales ORDER BY id";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>prueba 3</title>
<link rel="stylesheet" type="text/css" href="grid.css" />
<link rel="stylesheet" type="text/css" href="components/css/common_style.css" />
<!--<link href="styles.css" rel="stylesheet" type="text/css" />-->
</head>
<body>
<h3>Buscar Sucursal</h3>
<form id="frbuscar" name="frbuscar" method="get" action="">
<input name="criterio" type="text" id="criterio" size="25" value="<?php echo $criterio; ?>" />
<input type="submit" id="btbuscar" value="Buscar" />
</form>
<?php if ($total > 0) { ?>
<p><em>Total de Resultados: <?php echo $total; ?></em></p>
<table>
<tr>
<th></th>
</th>
</tr>
<tr>
<td>
<h1><?php echo $rsEmp['nombre_sucursal']; ?></h1>
<?php } ?>
</td>
</tr>
<table class="grid" style="width: " >
<thead>
<tr class="even">
<th class="even" height="35" class="odd row-selector">nombre sucursal</th>
<th class="even">cargo</th>
<th class="odd">abono</th>
<th class="even">balance</th>
</tr>
</thead>
<tbody>
<tr>
<td class="even" style="width: 30px;" ><?php echo $rsEmp['nombre_sucursal']; ?></td>
<td class="odd" style="width: 30px;" ><?php echo $rsEmp['depositos']; ?></td>
<td class="even" style="width: 30px;" ><?php echo $rsEmp['retiros']; ?></td>
<td class="odd" style="width: 30px;" ><?php echo $rsEmp['balance']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<p> </p>
</body>
</html>
como pueden observar en lugar de un menú puse un buscador y me funciona a la perfección, me hubiera gustado usar un menú dinámico pero pues no se pudo, si alguien me ayudara a utilizar un menú dinámico en lugar del buscador se lo agradecería mucho.