My query returns two days, say the 10th and the 11th, both just integers. I want to create an array for August with 31 rows, with blank data on days that do not exist in the database, and only data for the 10th and 11th. If I do something like:
$daysinmonth = array( "January"=>31, "February"=>29, "March"=>31, "April"=>30, "May"=>31, "June"=>30, "July"=>31, "August"=>31, "September"=>30, "October"=>31, "November"=>30, "December"=>31 );
$days = $daysinmonth[$month] - 1;
$i=0;
echo $numB;
while ($i<$days) {
$a = $i + 1;
$day = mysql_query($resultB,$i,"day");
if ( $a==$day ) {
$date[$i] = $a;
$movies[$i] = mysql_result($resultB,$i,"movies");
$shows[$i] = mysql_result($resultB,$i,"shows");
$music[$i] = mysql_result($resultB,$i,"music"); }
else { $date[$i] = $a;
$movies[$i] = "";
$shows[$i] = "";
$music[$i] = ""; } $i++; }
Which throws a MySQL error, of course, because there are only two rows of data. I don’t even know what to ask because I don’t understand most of anything.
1 Answer