Multidimensional arrays / Dynamic variables
| From: | David Rice | Date: | Sun, 09 Mar 2003 14:22:07 +0000 |
| Subject: | Multidimensional arrays / Dynamic variables | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-26203@lists.php.net to get a copy of this message | ||
Okay the problem is adding another result to the multi-dimensional array
When i perform var_dump on the returned varialbe $tips i get
array(1) { [2]=> array(1) { [0]=> string(10) "2003-03-07" } }
I know that there are 2 results missing here for when the key of the array is 1 ($staffid = 1)
the results are such that the array should look like this
array(1) { [1]=> array(2) { [0]=> string(10) "2003-03-06"
[1]=> string(10) "2003-03-07" }
[2]=> array(1) { [0]=> string(10) "2003-03-07" }
}
now I just need some help getting my code to produce the second output.
=================================================================
<?
function tips($weekstart){
$start = date('Ymd',strtotime($weekstart));
$query = "SELECT * FROM Rota WHERE date >= $start and date <= ($start + INTERVAL 6 DAY) ORDER BY staffid";
$result = mysql_query($query);
_________________________________________________________________
Overloaded with spam? With MSN 8, you can filter it out http://join.msn.com/?page=features/junkmail&pgmarket=en-gb&XAPID=32&DI=1059