Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/08/2009, 14:44
Avatar de urgido
urgido
 
Fecha de Ingreso: febrero-2005
Mensajes: 2.351
Antigüedad: 21 años, 8 meses
Puntos: 25
Respuesta: select en php que de un resultado

Código PHP:
<HTML>



<head><meta http-equiv='Content-Type' content=text/html; charset='iso-8859-1' /></head>
<body>
<form action="verificar2.php" method="post">
<input name="acupuntura" type="TEXT" value="1">
<input name="boton" type="submit" value=" cargar suscriptores acupuntura">

</form>

</body>
</HTML>

esta de aca es el php


<?php
$cod
=$_POST['acupuntura'];

$dbh=mysql_connect ("localhost", "holistik", "marcelx")
or die (
'problema conectando porque :' . mysql_error());
// seleccionado la base de datos
mysql_select_db ("holistik_info",$dbh);
// preparando la instruccion sql
$q = "select * from campos where acupuntura=".$cod;
// ejecutando el query select regresa un rowset
$campos = mysql_query($q, $dbh) or die ("problema con la base de datos") ;


$renglon= mysql_fetch_array($campos);
if(
mysql_num_rows($campos)>0){
 while (
$renglon= mysql_fetch_array($campos))

 {

 echo 
".$renglon[1].";
 echo 
".$renglon[2].";
 }
}else{
 die(
"No hay campos a mostrar");
}
SALUDOS
__________________
Hospedaje Web al mejor costo!