Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/11/2015, 17:20
servez1
 
Fecha de Ingreso: noviembre-2015
Ubicación: mexico
Mensajes: 1
Antigüedad: 8 años, 5 meses
Puntos: 0
Problema con FPDF y consulta mysqli

Tengo una problema aqui tengo el codigo.

para el pdf

<?php
include('fpdf/fpdf.php');
include ('include/conexion.php');
$pdf = new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', '', 10);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(15, 10, '', 0);
$pdf->Cell(200, 10, 'Escuela Primaria Lazaro Cardenas', 0);
$pdf->Ln(10);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(25, 10, '', 0);
$pdf->Cell(100, 10, 'Relacion de Alumnos del plantel', 0);
$pdf->SetFont('Arial', '', 9);
$pdf->Ln(10);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(25, 10, '', 0);
$pdf->Cell(18, 10, '', 0);
$pdf->Cell(20, 10, '', 0);
$pdf->Cell(50, 10, 'Fecha: '.date('d-m-Y').'', 0);
$pdf->Ln(23);
$pdf->SetFont('Arial', 'B', 8);
$pdf->Cell(15, 8, 'Numero', 0);
$pdf->Cell(20, 8, 'Nombre', 0);
$pdf->Cell(30, 8, 'Apellido Paterno.', 0);
$pdf->Cell(30, 8, 'Apellido Materno.', 0);
$pdf->Cell(25, 8, 'Curp', 0);
$pdf->Cell(10, 8, 'Edad', 0);
$pdf->Ln(8);
$pdf->SetFont('Arial', '', 8);

$query = "Select * From info";
$result = mysqli_query($link, $query);
while($alumnos2 = mysqli_fetch_array($result, MYSQLI_BOTH)){

$item = $item+1;
$pdf->Cell(15, 8, $item, 0);
$pdf->Cell(20,8, $row['nombre'],0);
$pdf->Cell(20,8, $row['apepa'],0);
$pdf->Cell(20,8, $row['apema'],0);
$pdf->Cell(20,8, $row['curp'],0);
$pdf->Cell(20,8, $row['edad'],0);
$pdf->Ln(8);
}

$pdf->Output();
?>

********************************************
y este es el error que me da


( ! ) Notice: Undefined variable: link in C:\wamp\www\Proyecto\relacion_alumnos.php on line 37
Call Stack
# Time Memory Function Location
1 0.0016 278296 {main}( ) ..\relacion_alumnos.php:0

( ! ) Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\wamp\www\Proyecto\relacion_alumnos.php on line 37
Call Stack
# Time Memory Function Location
1 0.0016 278296 {main}( ) ..\relacion_alumnos.php:0
2 1.0256 914248 mysqli_query ( ) ..\relacion_alumnos.php:37

( ! ) Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\wamp\www\Proyecto\relacion_alumnos.php on line 38
Call Stack
# Time Memory Function Location
1 0.0016 278296 {main}( ) ..\relacion_alumnos.php:0
2 1.0258 914416 mysqli_fetch_array ( ) ..\relacion_alumnos.php:38
FPDF error: Some data has already been output, can't send PDF file