Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/02/2011, 10:31
esgoru
 
Fecha de Ingreso: febrero-2011
Mensajes: 10
Antigüedad: 13 años, 2 meses
Puntos: 0
Respuesta: FOREACH: problema con impresion de lineas

ya lo he conseguido he eliminado el foreach y he metido la linea en el while, y se incrementa solo no he necesitado poner un ++ el codigo ha quedado asi
Código:
<?php
	session_start();
	


if(isset($_POST['aceptar'])){
if($_POST['aceptar']){
header("Content-type: image/jpg");	
include('../Conexion.php');
include "../libchart/classes/libchart.php";		
			
    
    $fechai =$_POST["fechai"];
    $fechaf =$_POST["fechaf"];
    
	

				
  
                $consulta ="SELECT p.nombre, count(*) from modelos m, proveedores p where p.codproveedores = m.proveedores_codproveedores and m.Fecha_Adquisicion between '" .$fechai. "' and '" .$fechaf. "' group by  m.proveedores_codproveedores"; 
                $resultado = mysql_query($consulta);
				
				
			 	$chart = new VerticalBarChart(500,250);
	
	$dataSet = new XYDataSet();
	
				
				 while($filas=mysql_fetch_row($resultado)){
							
							 $proveedor[i]=$filas[0];
							 
							$numero[i]=$filas[1];
							
						
	$dataSet->addPoint(new Point($proveedor[i], $numero[i]));
				}
				 

			 
				 
				
	

	

	
	$chart->setDataSet($dataSet);
	
	$chart->setTitle("Coches comprados a proveedores");
	$chart->render();
		
   }}	  
?>
<html> 
	<head> 
		<link rel="stylesheet" href="../ejecucion.css" type="text/css"> 
		<title>Proyecto Concesionario</title> 
	</head> 
	
	<body> 
			<div id="cabecera">
		<img src="../cabecera.jpg">
		</div>

		
		<h1>Grafico de coches por proveedor</h1>
		<hr> 
	
	<form name="cochesporvendedor" method="post">
			<div id="volver">
				<input type="submit" name="Volver" value="Volver" onClick="this.form.action='../menus/menugraficos.php';this.form.target='_self'">
			</div> 
        <table>
			<tr>

				<td><label>fecha inicio</label></td><td><p><input type="text" name="fechai" id="fechai" size="15" maxlength="45"/></td></tr>

			<tr>

				<td><label>fecha fin</label></td><td><input type="text" name="fechaf" id="fechaf" size="15" maxlength="45"/></td></tr>

			<tr>
			
			<tr>
				<td><input type="submit"  name="aceptar" value="Aceptar" /></td><td><a href="../menus/menugraficos.php"><input type="reset"  name="cancelar" value="Cancelar" /></a></td>
			</tr>					
        </table>

                        
                   

                            

                    </form>


	<div id="pie">
		<img src="../pie.jpg">
		</div>
		
			
		
	</body> 
</html>