stephanie is: alright alright…

i’ve been wanting to move further away from livejournal for some time – simply because i don’t like a vital part of my site to rely on outside servers. danny and i hve installed a very simple php journal system that will allow comments. i shall probably double post into livejournal too so friends lists can still see my entries – but maybe turn off comments and link to my comment page.

anyway it is going to be forever before it is ready to go live. i have entered 46 of my 1756 entries into the database. doh. i’m not sure if i’ll ever catch up…

only two php things left that i want to figure out how to change. i’d like to figure out how to put leading zeros on the 24-hour hour code, and i want to display the results of an array from the database in reverse order (so you see links from newest to oldest)… any php gurus with ideas?

0 thoughts on “

  1. i totally feel you on the having the journal/weblog rely on livejournal servers which is why I moved my journal off of LJ and only post the more “private” thoughts here on LJ or I link to my journal on my site.

    Just let us know the link, I’ll link to it from my weblog on my site ๐Ÿ™‚

  2. greymatter

    hi,
    did you install greymatter for it? or written a php script yourself?
    greymatter is a free php script thing…i use it for my blog (www.moonsis.de/blog/), my privat diary and dream journal on my site. heh…
    it has comments, karma voting and archives all…pretty good and you can customize all you want in it.
    anyway. just wanted to say this is what i use and it is pretty neat. heh.
    bye bye
    Moonsis

  3. change the sql statement to select by DESC (descending). example:
    “select name, blurb from entries where month=’$month’ order by entry_id desc”;

    that will order them from newest to oldest. otherwise, just use a function to reverse the array:
    $result = array_reverse ($input);

    for the leading zeros, i’m assuming hour and minute are separate:
    if ($hour < 10) { $hour = “0”.$hour; }

    • hmm… i have this:

      $query2 = “SELECT month FROM $maintable GROUP BY month ORDER BY id”;

      but i kept breaking it when trying to edit it.

      here is the main part where is makes each drop-down-form link:

      while ($r2 = mysql_fetch_array($result2)) {
      extract($r2);
      echo “n

      grr. i am just learning php.

      • with regard to your SQL statement:

        – you can’t update a result set that’s produced by a GROUP BY because a single line in the result set (possibly) refers to many lines in the table.

        – if you are just trying to order the result set, using DESC is what you want. GROUP BY is for grouping multiple records and averaging them or totalling them… if you see what i mean.

        ๐Ÿ™‚

          • i know what you mean…
            database design and manipulation and the Structured Query Language (SQL) is a complicated beast. i just finished my MSc project where i had to sort of learn it on the fly… most of the time, all i can think is “say what?”

            ๐Ÿ™‚

          • You should check the MySQL Documentation as well. I’m assuming you’re using mysql. The syntax for the select statement is determined by the database and what features that it supports. PHP just passes that information through to mysql. So basically, you have to learn both the PHP language and SQL (which really only has 5 statements select, create, delete, update, and insert) as well as the intricacies of mysql. I’ve not really done much PHP as I prefer perl myself, but mysql is a pleasure to work with and not too difficult to learn. It’s pretty straightforward and logical and has good documentation so check it out and it will help you with your PHP endeavors.

      • are you just trying to get a list of the months?? i’m not exactly sure what this is trying to do…but if so:
        $query2 = “SELECT DISTINCT month FROM $maintable ORDER BY id DESC”;

        if you are just trying to get the months, i’m not sure what the id would have to do with it. insufficient information! can you elaborate on what you are trying to do? (unless you figure it out, of course!)

Leave a Reply to moonsis x

Your email address will not be published.

CommentLuv badge