#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Boston MA USA
    Posts
    23
    Rep Power
    0
    Ok... you guys have been a big help
    But alas im stumped
    this is what i have as of now:
    <?php
    // connect to the db duh
    $db = mysql_connect("localhost", "user", "password");
    mysql_select_db("dbtable",$db);
    // select and arrange the data by the datetime row latest first etc
    $result = mysql_query("select * from body order by date desc");
    // insert the table parameters
    echo "<table border=0 cellpadding=0 cellspacing=10 width=475 height=473 bgcolor=#333399>n";
    // get the date column, which is (i presume) a datetime type column
    $thedatetime = mysql_result($result,0,"date");
    // call the function
    changeFormat($thedatetime);
    // now the function itself
    function changeFormat($fromQuery) {
    // let's split first by spaces
    $splitDateTime = explode(" ",$fromQuery);
    // and now $splitDateTime is an array which $splitDateTime[0] is the date and $splitDateTime[1] is the time..
    // let's split these again
    $DateElements = explode("-",$splitDateTime[0]);
    $TimeElements = explode(":",$splitDateTime[1]);
    // Now we format it now that its been split up
    $ReturnVar = '<b>'.$DateElements[1].'.'.$DateElements[2].'.'.$DateElements[0].'</b> '.$TimeElements[0].':'.$TimeElements[1];
    // now the row for the date/time/comment
    echo "<tr bgcolor=#333366><td>n";
    echo $ReturnVar;
    }
    while ($myrow = mysql_fetch_row($result)) {
    changeFormat($myrow[0]);
    printf(" <font size=-2>%s</font></td></tr><tr><td valign=top>%s</td></tr>n", $myrow[1], $myrow[2]);
    }
    echo "</table>n";
    ?>

    on run.... it outputs http://www.likwid.org/test/multiplepulldata.php3

    07.21.2000 15:14 has data... but it dosen't display (because its only looping the date/time loop and not grabbing from the next loop)

    how would i go about fixing this???

    thnx!



    [This message has been edited by godeater (edited July 21, 2000).]
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Boston MA USA
    Posts
    23
    Rep Power
    0
    | 2000-07-21 10:01:00 | woo | hopefully this makes more sense |
    | 2000-07-21 10:02:00 | hey | hopefully this makes more sense than before |
    | 2000-07-21 08:02:00 | yeah | i hope this makes more sense than before |
    | 2000-07-21 10:25:43 | blah123 | woot123 |
    | 2000-07-21 10:23:35 | bla1h | woo1t |
    | 2000-07-21 12:25:00 | this is a comment | this is the body |
    | 2000-07-21 12:44:42 | hi | there |
    | 2000-07-21 15:14:46 | this is totally ****ed up dammit | work you ****er!
    | 2000-07-21 15:14:54 | asdf | dfdf |
    | 2000-07-21 16:02:06 | 123 | 1234 |

    also... this is what i have in the table
    but its not showing the latest entry??
    the hell??

IMN logo majestic logo threadwatch logo seochat tools logo