0
<?php
	include 'connection.php';
	$data = mysql_query( "SELECT Date,color_code, COUNT(color_code) FROM paintshop WHERE Date BETWEEN '$startDate' AND '$endDate'") or die('error');
	while($rw = mysql_fetch_array($data)){ 
	?>
    <td width="59" height="25" class="style5Copy"><?php echo $rw['Date']; }?></td>

i want display the dates between i post from the form..
eg: start date = 1-12-2011 until end date 7-12-2011
(meaning 1-12-2011,2-12-2011,3-12-2011,4-12-2011,5-12-2011,6-12-2011,7-12-2011):-/

4
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by HITMANOF44th
0

Your query looks fine and should display dates (if they're selected as inputs in your form). Unless, you have fixed dates. For example, startDate begins from 1-12-2011 and endDate is only specified by your clients.

So What's up with your piece of code? Is it doing what it is expected to do or you have problems with it?

0
<?php

    include 'connection.php';
    $data = mysql_query( "SELECT Date,color_code, COUNT(color_code) FROM paintshop WHERE Date BETWEEN '$startDate' AND '$endDate'") or die('error');
    $result = mysql_query($data) or die(mysql_error());
 
echo "<table>
<tr>
	<td>row1</td>
	<td>row2</td>
	<td>row3</td>
	<td>row4</td>
</tr>"; 
    
    while($row = mysql_fetch_array($result, MYSQL_BOTH)){
 echo "<tr>
	<td>".$row['somerow']."</td>
	<td>".$row['anotherrow']."</td>
	<td>".$row['otherrow']."</td>
	<td>".$row['month']."</td>
</tr>";
}
echo "</table>"
?>

Edited by HITMANOF44th: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.