sandrulis Posted January 31, 2012 Report Share Posted January 31, 2012 Sveiki, man kārtējā problēma šoreiz ar array: ievadod šo kodu: $result=mysql_query("SELECT * FROM articles"); while($row = mysql_fetch_array($result)) { $a = array(date("d",$row['time']) => array("links",'id')); print_r($a); } iegūstu: Array ( [01] => Array ( [0] => links [1] => id ) ) Array ( [13] => Array ( [0] => links [1] => id ) ) Array ( [30] => Array ( [0] => links [1] => id ) ) Bet kā lai dabōnu šo te visu zem viena array (kā piemērā): Array ( [01] => Array ( [0] => link [1] => id ) [13] => Array ( [0] => links [1] => id ) [30] => Array ( [0] => links [1] => id ) ) Bet ja ievadu šo kodu: $result=mysql_query("SELECT * FROM articles"); while($row = mysql_fetch_array($result)) { $a[] = array(date("d",$row['time']) => array("links",'id')); } print_r($a); Tad viss aiziet grīstē. Ceru ka sapratāt ko vēlos un ceru ka varat palīdzēt Quote Link to comment Share on other sites More sharing options...
briedis Posted January 31, 2012 Report Share Posted January 31, 2012 (edited) $a[date("d",$row['time'])][] = array("links",'id'); Edited January 31, 2012 by briedis Quote Link to comment Share on other sites More sharing options...
sandrulis Posted January 31, 2012 Author Report Share Posted January 31, 2012 liels paldies, tas ir tas ko gribēju Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.