Jump to content
php.lv forumi

php array sakaārtot augošā secībā pēc laika


ziedinjsh

Recommended Posts

Sveiki, mēģinu panāk, ka no divām tabulām datus saliek kopā un izvad augošā secībā pec laika
 

$comments = ORM::for_table('comments')->where('uid', $id)->find_array();
$replays = ORM::for_table('comment_replays')->where('uid', $id)->find_array();
$opinions = array_merge($comments, $replays);

foreach($opinions as $item => $key){
        echo $item.' = '.$key['time'].'<br>';
}
Link to comment
Share on other sites

Labi, principā es vispār nesaprotu, nafig viņš merdžo un kārto komentārus un replies pēc datumiem, nevis pēc parent id un tikai tad pēc datumiem.

Bet tas ir pie kājas; jautājums bija "kā no divām tabulām datus saliek kopā un izvad augošā secībā pec laika", un uz to ir atbildēts.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...