assuming you had a table named timeline you could run this to get all the info in it, and display it. use tables to format what the output looks like.
<?
$query = "SELECT * FROM timeline ORDER BY date DESC";
$result = MYSQL_QUERY($query);
$number = MYSQL_NUMROWS($result);
IF($number == 0){
ECHO "<font face=Arial sans-serif size=1>Nothing in your database yet :o)</font>";
}ELSE{
FOR($i=0;$number > $i;$i++){
list($date,$maybe_you_want_a_subject,$some_text,$anything_else,$put_it_here,$or_add_more) = mysql_fetch_array($result);
?>
Put all Your pretty HTML in here, and echo out the vairbles. heres an example (dont know how much you know about PHP so ill assume you know nothing to very little)
<table>
<tr>
<td> <p><font face='Arial, Helvetica, sans-serif' size='2'>
<?echo"$date";?></font></p>
</td>
</tr>
<tr>
<td width='144'>
<font size='1' face='Arial, Helvetica, sans-serif'>
<?echo"$maybe_you_want_a_subject";?>
</font>
</td>
<td width='144'>
<div align='right'>
<font size='1' face='Arial, Helvetica, sans-serif'>
<?echo"$some_text";?>
</font>
</div>
</td>
</tr>
</table>
<?}}?>
now obviously that is just a square, and will look nothing like a timeline but you can figure out the HTML part. id suggest changing the variable names if you use this to something that makes more sence to you. then just echo whatever you name your variables 🙂
Sledgeweb wrote:
Hello-
I've seen some interesting interactive timelines out there created using PHP. I'm familiar with PHP and mySQL, but I've never attempted anything like this. Anywho, I'm wanting to create an interactive timeline... basically you could use some forms to add entries to the timeline, and when you viewed the timeline it would display correctly with the dates spread out appropriately. Maybe you supply a begin and end date for the timeline, and then use some scripting to figure out where to place a particular date on the line.
Does anyone know where I can find some source examples or tutorials on doing this? It would be a HUGE help.