0

I hope it's the heat, this is the second question today and it's one problem after the other. Relatively simple stuff...

I have this query ...

while ($resultV = mysql_fetch_assoc($metQueryViews)) { $allViews[] = $resultV; }

The date it's getting is:-

date        Count
NULL         6
14-5-2009   12
15-5-2009   21
26-6-2009   18
29-6-2009   61

I'm trying to build an array, that reads out

"14-5-2009" = > "12"

But, the above while statement produces what seems to be a multi-dimensional array or sommet, which has the field name => value.

Thoughts on a little post card are most welcome.

1
  • Can you post your query or at least a list of columns you expect, that would make it easier to give you a certain answer. Commented Jun 29, 2009 at 17:56

2 Answers 2

5
$allViews[] = array($resultV["date"] => $resultV["count"]);
Sign up to request clarification or add additional context in comments.

Comments

0
$allViews = array();
while (list($date, $count) = mysql_fetch_row($metQueryViews)) {

    $allViews[$date] = $count;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.