Ver Mensaje Individual
  #6 (permalink)  
Antiguo 05/04/2012, 14:36
Avatar de arcanisgk122
arcanisgk122
 
Fecha de Ingreso: junio-2010
Mensajes: 755
Antigüedad: 13 años, 11 meses
Puntos: 28
Respuesta: buscador php para mysql

intente hacer cambios como:

Código PHP:
Ver original
  1. <?php
  2.     header('content-type: text/html; charset=utf-8');
  3.     // Si entramos es que todo se ha realizado correctamente
  4.     include("config/config.php");
  5.     $link = mysql_connect ($dbhost, $dbusername, $dbuserpass);
  6.     mysql_select_db($dbname,$link) or die('No se puede seleccionar la base de datos<br>');
  7.     $title=$_POST['title'];
  8.     $website=$_POST['wscb'];
  9.     $fecsea1=$_POST['fecsea1'];
  10.     $fecsea2=$_POST['fecsea2'];
  11.     //busqueda por website-> luego titulo-> luego fecha:
  12.     $sql = "SELECT * FROM art WHERE website LIKE '$website' AND title MATCH(title) AGAINST ('$title' IN BOOLEAN MODE) AND DATE_FORMAT(create_date_art) BETWEEN '$fecsea1' AND '$fecsea2' ORDER BY art_pk DESC";
  13.     $arreglo = mysql_query($sql,$link);
  14.     $resultado = mysql_num_rows($arreglo,$link);
  15.     ?>
  16.     <table border="0" cellspacing="0" cellpadding="0">
  17.         <tr>
  18.             <td width="70">ID</td>
  19.             <td width="400">Title</td>
  20.             <td width="200">Web Site</td>
  21.             <td width="150">Fecha Creacion</td>
  22.             <td width="100">Update Link</td>
  23.         </tr>
  24.     <?php
  25.     //deberia ir un ciclo while dentro de php
  26.     while($printer=mysql_fetch_array($resultado)){
  27.     $id = $printer['art_pk'];
  28.     $fecha = $printer['create_date_art'];
  29.     $nombre = $printer['title'];
  30.     $web = $printer['website'];
  31.     ?>
  32.         <tr>
  33.             <td><?php echo " $id "; ?></td>
  34.             <td><?php echo " $nombre"; ?></td>
  35.             <td><?php echo " $web "; ?></td>
  36.             <td><?php echo " $fecha "; ?></td>
  37.             <td> <a href="index4.php">Link</a></td>
  38.         </tr>
  39.     <?php
  40.     }
  41.     //ak terminaria el ciclo While.
  42.     ?>
  43.     </table>
  44.     <?php  
  45.    
  46. ?>

ERRORES

Warning: mysql_num_rows() expects exactly 1 parameter, 2 given in C:\xampp\htdocs\liste.php on line 14

Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\xampp\htdocs\liste.php on line 26
__________________
Cooler Master Gladiator 600 - AMD PHENOM II X4 955 @ 3.5GHZ
GA-MA78GM-US2H - Super Talent 800 2GB x 2 Dual, (Unganged)
PSU Cooler Master eXtreme Power Plus 500W - Saphire R7-260OC-2GB