Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/07/2010, 07:26
waty90
 
Fecha de Ingreso: diciembre-2006
Mensajes: 153
Antigüedad: 17 años, 5 meses
Puntos: 1
ayuda! como arreglar esta consulta sql .

hola, estoy probando un script que se llama codeka y me da el siguiente error en 2 archivos>

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/server/public_html/codeka/ubicaciones/rejilla.php on line 15


este es comienzo de rejilla.php da error en linea 15.

Código PHP:
<?php
include ("../conectar.php");

$codubicacion=$_POST["codubicacion"];
$nombre=$_POST["nombre"];
$cadena_busqueda=$_POST["cadena_busqueda"];

$where="1=1";
if (
$codubicacion <> "") { $where.=" AND codubicacion='$codubicacion'"; }
if (
$nombre <> "") { $where.=" AND nombre like '%".$nombre."%'"; }

$where.=" ORDER BY nombre ASC";
$query_busqueda="SELECT count(*) as filas FROM ubicaciones WHERE borrado=0 AND ".$where;
$rs_busqueda=mysql_query($query_busqueda);
[
FONT="Arial Black"]$filas=mysql_result($rs_busqueda,0,"filas");  [/FONT]
////////////linea 15 ////////////// $filas=mysql_result($rs_busqueda,0,"filas");

?>


y el otro donde da error es este central2.php>

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/server/public_html/codeka/central2.php on line 8

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/server/public_html/codeka/central2.php on line 21

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/server/public_html/codeka/central2.php on line 34

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/server/public_html/codeka/central2.php on line 47




Código PHP:
<?php
include ("./conectar.php");
$hoy=date("Y-m-d");

$sel_tmp="SELECT codalbaran FROM albaranestmp WHERE datediff('$hoy',fecha) > 2";
$rs_tmp=mysql_query($sel_tmp);
$contador=0;
while (
$contador mysql_num_rows($rs_tmp)) {
    
$codalbaran=mysql_result($rs_tmp,$contador,"codalbaran");
    
$sel_borrar="DELETE FROM albalineatmp WHERE codalbaran='$codalbaran'";
    
$rs_borrar=mysql_query($sel_borrar);
    
$contador++;
}

$sel_borrar="DELETE FROM albaranestmp WHERE datediff('$hoy',fecha) > 2";
$rs_borrar=mysql_query($sel_borrar);

$sel_tmp="SELECT codalbaran FROM albaranesptmp WHERE datediff('$hoy',fecha) > 2";
$rs_tmp=mysql_query($sel_tmp);
$contador=0;
while (
$contador mysql_num_rows($rs_tmp)) {
    
$codalbaran=mysql_result($rs_tmp,$contador,"codalbaran");
    
$sel_borrar="DELETE FROM albalineaptmp WHERE codalbaran='$codalbaran'";
    
$rs_borrar=mysql_query($sel_borrar);
    
$contador++;
}

$sel_borrar="DELETE FROM albaranesptmp WHERE datediff('$hoy',fecha) > 2";
$rs_borrar=mysql_query($sel_borrar);

$sel_tmp="SELECT codfactura FROM facturastmp WHERE datediff('$hoy',fecha) > 2";
$rs_tmp=mysql_query($sel_tmp);
$contador=0;
while (
$contador mysql_num_rows($rs_tmp)) {
    
$codfactura=mysql_result($rs_tmp,$contador,"codfactura");
    
$sel_borrar="DELETE FROM factulineatmp WHERE codfactura='$codfactura'";
    
$rs_borrar=mysql_query($sel_borrar);
    
$contador++;
}

$sel_borrar="DELETE FROM facturastmp WHERE datediff('$hoy',fecha) > 2";
$rs_borrar=mysql_query($sel_borrar);

$sel_tmp="SELECT codfactura FROM facturasptmp WHERE datediff('$hoy',fecha) > 2";
$rs_tmp=mysql_query($sel_tmp);
$contador=0;
while (
$contador mysql_num_rows($rs_tmp)) {
    
$codfactura=mysql_result($rs_tmp,$contador,"codfactura");
    
$sel_borrar="DELETE FROM factulineaptmp WHERE codfactura='$codfactura'";
    
$rs_borrar=mysql_query($sel_borrar);
    
$contador++;
}

$sel_borrar="DELETE FROM facturasptmp WHERE datediff('$hoy',fecha) > 2";
$rs_borrar=mysql_query($sel_borrar);

?>
<!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>Documento sin t&iacute;tulo</title>
<style type="text/css">
<!--
.Estilo4 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
.Estilo5 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 10px;
}
.Estilo6 {font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;}
-->
</style>
</head>

<body>
<table width="90%" border="0" align="center">
  <tr height="90px">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr height="200px">
    <td>&nbsp;</td>
    <td><div align="center"><img src="img/central.jpg" width="550" height="200" border="0" /></div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center" class="Estilo6">CodeKa Facturaci&oacute;n Web </div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center" class="Estilo6">Versi&oacute;n 1.0 </div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><div align="center" class="Estilo6">&copy; 2008</div></td>
    <td>&nbsp;</td>
  </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><table width="50%" border="0" align="center">
        <tr>
          <td><div align="center"><span class="Estilo5">Resolución óptima 1024 x 768 píxeles  </span></div></td>
        </tr>
      </table></td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td height="27">&nbsp;</td>
      <td><table width="50%" border="0" align="center">
        <tr>
          <td width="38%"><div align="right"><img src="img/firefox.gif" width="80" height="15" /></div></td>
          <td width="62%"><span class="Estilo5">Aplicación optimizada para Firefox </span></td>
        </tr>
      </table></td>
      <td>&nbsp;</td>
    </tr>
</table>
</body>
</html>



àlguien puede exarme un cable?
muchas gracias saludos