If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

The $query itself is valid. I have tried several different queries, and no matter what i try, the script still dies prematurely. I'm still trying to get this 'mysqli' system down. I one other loop where the same thing is happening. What am I missing?

I'm guessing (without going through everything with a fine-toothed comb) that you could get what you need with a single query, using a BETWEEN <start_date> AND <end_date> clause in your WHERE clause, eliminating the for_loop.

Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett

No, the for_loop is necessary because I need to know if the criteria is null. Using 'BETWEEN' only returns data that matches the criteria, in this case, 4 or 5 days out of 7. I need the full array from 0 to 6.

Why do you need a "full array from 0 to 6" ? If you use the single query method and only get results for days 1, 3, and 4, isn't it straightforward that days 0, 2, and 5-6 need to have "empty" place holders?

You execute the query, get the results - store them in an array (indexed by day). Then you do a for() loop to loop through all days you want to display. For each of the days, if data exists in the results array you previously created, display the data from the DB. Otherwise, the DB didn't return anything from that day, so output some empty placeholder and move on. Lather, rinse, repeat.

Last edited by Weedpacket; 02-26-2013 at 05:32 PM.
Reason: reinserted a vital negation

Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmailI'd rather be a comma, then a full stop.User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

You said earlier that your original code "dies after the first iteration". If you're not getting anything then it would seem that it's dying during the first iteration (of either loop).
Does "not getting anything" include not getting anything from the echo $Count . ' !! ' . $IncDate . '<br>'; line?

Have you verified that the query itself is correct, and not simply failing (i.e., perhaps $result is false - what then? The value of $mysqli->error would give MySQL's reason for failing such as, for example, unquoted non-numeric values.)