Jump to content

Recommended Posts

Hello,

 

This is my script-->

 

<?php

include_once ("jpgraph/src/jpgraph.php");

include_once ("jpgraph/src/jpgraph_bar.php");

include('logindb.php');

 

 

$sql = mysql_query("SELECT accommodatie, faciliteiten, ligging, prijs

                           FROM enquete

                           WHERE Park LIKE '%".$_POST['parkres']."%'

                          AND Aankomst BETWEEN STR_TO_DATE('".$_POST['datebox']."','%d-%m-%Y')

                           AND STR_TO_DATE('".$_POST['datebox2']."','%d-%m-%Y')");

 

while($row = mysql_fetch_array($sql))

 

{

$databar[] = $row['accommodatie'];

$databar[] = $row['faciliteiten'];

$databar[] = $row['ligging'];

$databar[] = $row['prijs'];

$legbar[] = $row[''];

 

}

 

error_reporting(E_ALL);

 

$graph = new Graph(250,150,"auto");

$graph->SetScale("int");

$graph->img->SetMargin(50,30,50,50);

$graph->SetShadow();

 

$graph->xaxis->SetTickLabels($legbar);

 

 

$bplot = new BarPlot($databar);

$bplot->SetFillColor("lightgreen"); // Fill color

$bplot->value->Show();

$bplot->value->SetFont(FF_ARIAL,FS_BOLD);

$bplot->value->SetAngle(45);

$bplot->value->SetColor("black","navy");

 

 

 

$graph->Add($bplot);

$graph->Stroke();

?>

 

What I wan't is that the 4 selections only show the '1' files and count them

 

So what I can do is "Select COUNT(accommodatie) AS acc, COUNT(faciliteiten) AS fac" etc but than there have to something in the query to count "acc LIKE 1 AND fac LIKE 1". When I do this there is an MYSQL error...

 

Is there a way that in the WHILE I can give a count on the Selections from the query?

Link to comment
https://forums.phpfreaks.com/topic/70146-count-as-in-while/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.