Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/06/2008, 20:13
novatomx
 
Fecha de Ingreso: junio-2008
Mensajes: 2
Antigüedad: 15 años, 10 meses
Puntos: 0
Información Ayuda con un buscador

Hola masters pues miren primero que nada les dire que en cuestiones de programación mi experiencia no es mucha pero pues trato de aprender documentandome y ahora recurriendo a uds, les comento rapidamente que requiero hacer miren tengo una tabla donde almacenare informacion de un rifa q se pretende hacer del liceo necesito hacer una especie de buscador para ver si el boleto es o no un ganador aparentemente es un buscador aunque mas bien es una consulta el codigo que tengo es:

<?php
$link = mysql_connect("localhost", "bear" , "20086");

mysql_select_db("dragoni_rifa", $link);

$result = mysql_query("SELECT * FROM resultados where 'boleto'=$boleto ", $link);

if (mysql_fetch_array($result)){

echo "<table width = '100%' border = '1' bordercolor=#006699 bgcolor=> ";

echo "<tr><td><div align='center'>No. de Premio</div></td><td><div align='center'>No. de Boleto</div></td><td><div align='center'>Premio</div></td><td><div align='center'>Nombre</div></td><td><div align='center'>Apellido Paterno</div></td><td><div align='center'>Apellido Materno</div></td><</tr>";

while ($row = @mysql_fetch_array($result)) {

echo "<tr><td>".$row["numero"]. "</td><td>".$row["boleto"]."</td><td>".$row["premio"]. "</td><td>".$row["nombre"]."</td><td>".$row["apellidop"]. "</td><td>".$row["apellidom"]. "</td><</tr> "; } echo "</table> ";

}

else echo " TU TICKET NO FUE GANADOR EN ESTE SORTEO PERO TE INVITAMOS A QUE SIGAS PARTICIPANDO "; ?>

El form de consulta es:

<form id="form1" name="form1" method="post" action="buscalo.php">
<table width="395" border="0">
<tr>
<td width="117"><div align="right"><span class="Estilo1">Número de Boleto</span></div></td>
<td width="268"><label>
<input name="boleto" type="text" id="boleto" size="20" />
<input type="submit" name="button" id="button" value="Buscar" />
</label></td>
</tr>
</table>
</form>

La tabla es sql

CREATE TABLE IF NOT EXISTS `resultados` (
`numero` varchar(45) NOT NULL,
`boleto` varchar(12) NOT NULL,
`premio` varchar(100) NOT NULL,
`nombre` varchar(75) NOT NULL,
`apellidop` varchar(75) NOT NULL,
`apellidom` varchar(75) NOT NULL,
`status` varchar(50) NOT NULL,
PRIMARY KEY (`numero`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;


ya por ultimo cuando intento hacer la consulta me aparece est : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/dragonii/public_html/resultados/buscalo.php on line 8
TU TICKET NO FUE GANADOR EN ESTE SORTEO PERO TE INVITAMOS A QUE SIGAS PARTICIPANDO

espero que me puedan ayudar por que llevo un rato buscandole y la verdad ya me bloquee y ya no se por donde seguir gracias de antemano