Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/02/2012, 14:53
tesistas
 
Fecha de Ingreso: septiembre-2010
Mensajes: 74
Antigüedad: 13 años, 7 meses
Puntos: 1
Respuesta: pasar consulta mysql a pagina php, denme una mano porfa!!!!

Cita:
Iniciado por jartaud Ver Mensaje
Y porqué estas mandando ese objeto en formato json?
Puedes leer ese tutorial para avanzar.
gracias por el tuto, me sirvio mucho
pongo el codigo por si a alguien le llegara a servir

Código PHP:
<?php
include_once 'lib.php';


$conexionmysql_connect($dbhost$dbuser$dbpassword);
mysql_select_db($database$conexion);
$result mysql_query("SELECT id_stock, codigo, descrip, pre_min, pre_may  FROM stock where activo = '1'"$conexion);
echo
"<table border='2'>
<tr>
    <th>ID</th>
    <th>Codigo</th>
    <th>Descrip</th>
    <th>Prec.Min</th>
    <th>Prec.May</th>
</tr>"
;
$i=0;
while(
$row mysql_fetch_array($result)){
    echo 
"<tr>
        <td>$row[id_stock]</td>
        <td>$row[codigo]</td>
        <td>$row[descrip]</td>
        <td>$row[pre_min]</td>
        <td>$row[pre_may]</td>
          </tr>"
;
    
$i++;
}
echo 
"</table>";