ok... so this is what i have so far.... the comments speak for themselves
(for a view of what its doing... plz reffer to www.likwid.org/test/multiplepulldata.php3)
<?php
// connect to the db duh
$db = mysql_connect("localhost", "user", "pass");
mysql_select_db("table",$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";
// this is where it breaks how the hell do i fix it?
echo $ReturnVar;
// return($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";
?>
now... if you look at the page
the top entry has no comment/body (my 2nd and 3rd rows... $myrow[1] and [2]
what am i doing wrong thats causing this to do this?
any help would be greatly appreciated 🙂
thnx
-likwid