Cita:
Iniciado por David el Grande
Pero tu bucle while con el recorrido del resultado está antes de realizar la consulta (mysql_query), lo cual está mal, además, tratas de pasarle como parámetro $match cuando lo que debes pasarle es $qry (lógicamente, después de ejecutar la consulta). Y en cuanto a tu otra pregunta, puedes imprimir sólo las columnas que quieras.
he he he he.... muchas gracias David el Grande me resultoooo
y ya lo habia puesto en ese lugar pero con el valor $match y no con $qry
asi que gracias de verdad
aka dejo el codigo para las personas puedan verlo
Código PHP:
<?php
ob_start();
include("../config.php");
// connect to the mysql server
$link = mysql_connect($server, $db_user, $db_pass)
or die ("Could not connect to mysql because ".mysql_error());
// select the database
mysql_select_db($database)
or die ("Could not select database because ".mysql_error());
$match = "Select td_atencion.*, td_serv_real.*, td_maquina.*From (((td_histo inner join td_atencion on td_histo.ate_id=td_atencion.aten_id) inner join td_serv_real on td_histo.serv_id=td_serv_real.serv_id ) inner join td_maquina on td_histo.maq_id=td_maquina.maq_id) where td_maquina.maq_serie ='".$_POST['maq']."';";
$qry = mysql_query($match)
or die ("Could not match data because ".mysql_error());
while ($row = mysql_fetch_array($qry, MYSQL_ASSOC)) {
printf("ID: %s Fecha: %s", $row["aten_id"], $row["aten_fecha"]);
}
$num_rows = mysql_num_rows($qry);
if ($num_rows <= 0) {
echo "Lo Sentimos la serie ingresada no esta registrada: <strong>".$_POST['maq']."</strong><br>";
echo "<a href=detalle_maquina.php>Por Favor Ingrese Serie Nuevamente!</a>";
exit;
}
ob_end_flush();
?>
![Afirmando](http://static.forosdelweb.com/fdwtheme/images/smilies/afirmar.gif)
![Afirmando](http://static.forosdelweb.com/fdwtheme/images/smilies/afirmar.gif)
![Afirmando](http://static.forosdelweb.com/fdwtheme/images/smilies/afirmar.gif)
y la ultima como puedo poner estos resultados en orden asi como en una tabla o form se puede?