Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/11/2011, 12:44
javierojeda13
Usuario no validado
 
Fecha de Ingreso: enero-2011
Mensajes: 36
Antigüedad: 13 años, 3 meses
Puntos: 0
Exclamación error de codigo php sorry

tengo el sigueinte codigo en php y ajax, el caso es que que hay una linea de comando que meda error y no e podido corregirla espero me puedan ayudar esa linea lo que hace que cuando pongo datos me va filtrando la informacion automaticamente, les dejo el codigo resaltado la linea de error


<?php
require('config.php');
require('include/conexion.php');
require('include/funciones.php');
require('include/pagination.class.php');

$items = 10;
$page = 1;

if(isset($_GET['page']) and is_numeric($_GET['page']) and $page = $_GET['page'])
$limit = " LIMIT ".(($page-1)*$items).",$items";
else
$limit = " LIMIT $items";

if(isset($_GET['q']) and !eregi('^ *$',$_GET['q'])){
$q = sql_quote($_GET['q']); //para ejecutar consulta
$busqueda = htmlentities($q); //para mostrar en pantalla

$sqlStr = "SELECT * FROM banca_maracaibo,wm_san_jose WHERE linea_comunicacion LIKE '%$q%'";
$sqlStrAux = "SELECT count(*) as total FROM banca_maracaibo,wm_san_jose WHERE linea_comunicacion LIKE '%$q%'";
}else{
$sqlStr = "SELECT * FROM banca_maracaibo,wm_san_jose";
$sqlStrAux = "SELECT count(*) as total FROM banca_maracaibo,wm_san_jose";
}

$aux = Mysql_Fetch_Assoc(mysql_query($sqlStrAux,$link));
$query = mysql_query($sqlStr.$limit, $link);
?> <p><?php
if($aux['total'] and isset($busqueda)){
echo "{$aux['total']} Resultado".($aux['total']>1?'s':'')." que coinciden con tu b&uacute;squeda \"<strong>$busqueda</strong>\".";
}elseif($aux['total'] and !isset($q)){
echo "Total de registros: {$aux['total']}";
}elseif(!$aux['total'] and isset($q)){
echo"No hay registros que coincidan con tu b&uacute;squeda \"<strong>$busqueda</strong>\"";
}
?></p>

<?php
if($aux['total']>0){
$p = new pagination;
$p->Items($aux['total']);
$p->limit($items);
if(isset($q))
$p->target("busqueda.php?q=".urlencode($q));
else
$p->target("busqueda.php");
$p->currentPage($page);
$p->show();
echo "\t<table class=\"registros\">\n";
echo "<tr class=\"titulos\"><td>Titulo</td></tr>\n";
$r=0;
while($row = mysql_fetch_assoc($query)){
echo "\t\t<tr class=\"row$r\"><td><a href=\"http://www.mis-algoritmos.com/?p={$row['id']}\" target=\"_blank\">".htmlentities($row['linea_comunicacion'])."</a></td></tr>\n";
if($r%2==0)++$r;else--$r;
}
echo "\t</table>\n";
$p->show();
}
?>