Jump to content

Hilly_2004

Members
  • Posts

    63
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Hilly_2004's Achievements

Member

Member (2/5)

0

Reputation

  1. Firstly, thanks for all the help Mchl, it's very much appreciated. However, can I do the above without the need for a MYSQL function? It's just I'm still on MYSQL 4 and I'm unable to upgrade in the mean time due to circumstances beyond my control.
  2. Ha! I honestly thought it would just have been a simple SELECT statement and I was being an idiot somewhere! In terms of performance, I will only be bringing back 10 records, so hopefully if you have a working query it shouldn't effect performance that much?
  3. Although valid (bravo by the way! ), unfortunately the output is still the same... Timestamp, M_Timestamp_Edit and Timestamp_Edit. Just seen your update! Would it make any difference if I changed it from Timestamps to Date or would I stumble into the same problem?
  4. Is it possible? Here is my table (Events) Basically, I want to group the C_Timestamp, Timestamp, M_Timestamp_Edit, C_Timestamp_Edit and Timestamp_Edit as one and then order them based on the most recent (Descending). My SELECT statement looks like so... $query = "SELECT forum_members.M_FIRSTNAME, forum_members.M_SURNAME, Events.C_Timestamp, Events.Timestamp, Events.M_Timestamp_Edit, Events.C_Timestamp_Edit, Events.Timestamp_Edit FROM forum_members, Events WHERE forum_members.MEMBER_ID = Events.MEMBER_ID ORDER BY C_Timestamp DESC, Timestamp DESC, M_Timestamp_Edit DESC, C_Timestamp_Edit DESC, Timestamp_Edit DESC"; At the minute, it's just outputting information based on the order of the columns e.g. the first output is Timestamp, the second is M_Timestamp_Edit and the last being Timestamp_Edit. I'm thinking that because the information in the table is a UNIX Timestamp, it might be better formatting the columns as DATE and inserting and sorting by that way - would there be any difference? Thanks in advance for any help guys!
  5. Think of it like a "Recent Activity" widget... e.g. Stephen Hill has updated their profile... (2 hours ago...) Charlotte Morley has posted a submission... (3 hours ago...) The amount of information displayed above can obviously change depending on how in depth I want it to be, but the above is a good start.
  6. Is it possible to display data from 2 separate tables and order the way it's displayed based on 2 columns from the separate tables. e.g. forum_members MEMBER_ID | M_FIRSTNAME | M_SURNAME | M_PROFILEUPDATE submissions MEMBER_ID | TITLE | SUMMARY | TIMESTAMP M_PROFILEUPDATE and TIMESTAMP are obviously timestamp records, so hopefully the end goal would be to order the 2 tables based on this columns (the latest being displayed first). Thanks in advance for any help!
  7. Wahey! Get in, works like a charm. Have a look at your handy work: http://www.kingjamescc.co.uk/barchart.php
  8. Afraid not... When you echo the str variable, it just prints out: ");"
  9. I've just tested that and unfortunately the source code shows it as: var myData = new Array(); myData[0] = new Array('Bowled','24'); myData[1] = new Array('Caught','11'); myData[2] = new Array('L.B.W.','5'); ...it needs to be in the exact same format as: var myData = new Array(['Bowled', 23], ['Caught', 44], ['LBW', 11]);
  10. Simple really. I'm trying to go from a PHP array to a JavaScript array in the following format: var myData = new Array(['Bowled', 23], ['Caught', 44], ['LBW', 11]); My question is...how? The data to populate the array will be retrieved from a table in the database e.g. Wicket_ID How_Out Number_Of_Times 1 Bowled 23 2 Caught 44 3 LBW 11 How do I retrieve this data from the database, make it into an array, and then pass that array across into it's JavaScript equivilant? Any help whatsoever would be greatly appreciated!
  11. Fantastic, works a treat, cheers Barand. One thing I needed to add to get it to work was: $monthyear = $myrow['monthyear']; ...but that's trivial anyway. Once again, thank you!
  12. ....or something like this: (Don't know how valid this is mind you) SELECT * FROM tbl_news WHERE DATE = DATE_FORMAT('$VARIABLE', '%M %Y') ORDER BY Date
  13. Works a treat....cheers Barand. One more, and I think this is the easy part. Obviously with this it will echo out: July 2008 etc... On the next page I have to pass across a variable for the SELECT procedure to get all of the records in that month. Will it be something like: SELECT * FROM tbl_news WHERE Date = '%M %Y' ORDER BY Date
  14. $result = mysql_query("SELECT DISTINCT DATE_FORMAT(Date, '%M %Y') as monthyear FROM tbl_news ORDER BY Date",$connect); while($myrow = mysql_fetch_array($result)) { echo $monthyear; echo "</br>"; } Obviously I'm doing it wrong.
  15. The problem with that I'm guessing is that it requires me to enter the specific month e.g. May 2008. I want the script to dynamically check if there have been any records created, and sort them into the relevant months.... e.g. The end list may look like: June 2007 January 2008 April 2008 May 2008 etc....
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.