dj-kenpo Posted April 30, 2007 Share Posted April 30, 2007 so I have a query that grabs the 10 latest updates to my site (it's a seperate table that tracks inserts) as of now, you can see in the example output if I add 3 photos, it lists each, I'd much prefer to to have the system say, Adam added 3 new photos... (only if they happen one after the other though with no breaks inbetween!) but how would I do this? load the result into another array and then sort? I'm having trouble wrapping my head around it. here's the normal call $sql_update_pings = "SELECT * FROM update_pings WHERE User_ID = $User_ID ORDER BY Timestamp DESC, ID DESC LIMIT 10"; $result_update_pings = mysql_query($sql_update_pings); while ($row_update_pings = mysql_fetch_array($result_update_pings)) { $update_pings_ID = $row_update_pings["ID"]; $update_pings_Title = $row_update_pings["Title"]; $update_pings_Mode = $row_update_pings["Mode"]; $update_pings_Parent = $row_update_pings["Parent"]; $update_pings_Timestamp = $row_update_pings["Timestamp"]; .......etc....... result: # Adam added a new journal entry entitled 'How to - Wireless hand crank mouse' - Wednesday, April 11 # Adam added a new journal entry entitled 'Ferrets hide things better than bunnies.' - Tuesday, April 3 # Adam added a new photo to 'Loki the ferret' - Tuesday, April 3 # Adam added a new journal entry entitled 'VNV Nation - Judgement' - Monday, April 2 # Adam added a new photo to 'Loki the ferret' - Friday, March 30 # Adam added a new photo to 'Loki the ferret' - Friday, March 30 # Adam added a new photo to 'Loki the ferret' - Friday, March 30 # Adam added a new CV item 'Chicago Tribune "Bio-artists bridge the gaps between arts and sciences" March 8th 2007' - Friday, March 30 the actual query can be seen running at brandejs.ca/journal.php if it helps cheers! Link to comment https://forums.phpfreaks.com/topic/49257-mysql-advanced-sorting-and-condensing-of-queries/ Share on other sites More sharing options...
trq Posted April 30, 2007 Share Posted April 30, 2007 only if they happen one after the other though with no breaks inbetween! What exactly do you mean by no breaks in between? Link to comment https://forums.phpfreaks.com/topic/49257-mysql-advanced-sorting-and-condensing-of-queries/#findComment-241342 Share on other sites More sharing options...
dj-kenpo Posted April 30, 2007 Author Share Posted April 30, 2007 # Adam added a new photo to 'Loki the ferret' - Tuesday, April 3 # Adam added a new journal entry entitled 'VNV Nation - Judgement' - Monday, April 2 # Adam added a new photo to 'Loki the ferret' - Friday, March 30 # Adam added a new photo to 'Loki the ferret' - Friday, March 30 # Adam added a new photo to 'Loki the ferret' - Friday, March 30 would be adam added 3 photos to ... not 4 photos Link to comment https://forums.phpfreaks.com/topic/49257-mysql-advanced-sorting-and-condensing-of-queries/#findComment-241351 Share on other sites More sharing options...
dj-kenpo Posted April 30, 2007 Author Share Posted April 30, 2007 anyone? Link to comment https://forums.phpfreaks.com/topic/49257-mysql-advanced-sorting-and-condensing-of-queries/#findComment-241720 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.