This is what it's for:
http://vanilanila.com/notebooks/index.php
How it basically works is a text box takes what you write and stores it in a database with an "id number".
But on the same page it also displays all these different blocks of text, categorically, by their "id number".
But I found the second part tricky.. it's hard to take the text, and the "id numbers", and make it look like it does...
This is how I did it, but I'd love to hear of a simpler or better way...
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div style="text-align:center;">
<div style="text-align:center; font-size:36px; text-decoration:underline"> Notes: </div>
<br />
<div><form action="submit.php" method="post">
<div>
<input type="text" style="width:400px;" name="notes" />
<input name="category" type="hidden" value="0" />
</div>
<div>
<br />
<br />
<div style=" font-size:36px; text-decoration:underline;">Category: <a style="font-size:18px;" href="edit.php" />(edit)</a></div>
<br />
<?php
$con = mysql_connect ("localhost","USERNAME","PASSWORD"); // ready db connect
if(!$con){
die("could not connect". mysql_error());
}
mysql_select_db("vanilani_notebooks",$con); // execute connect and select db
// Find highest ID number -- for when selecting/making the "new category"
$result = mysql_query("SELECT ID FROM Categories ORDER BY ID DESC LIMIT 1");
while ($row = mysql_fetch_assoc($result)) {
$h = $row['ID'];
}
// Find lowest ID number - to use to know when the ID's in the DB table has increased (and to <br /> and echo the next numbe)
$result = mysql_query("SELECT ID FROM Categories ORDER BY ID ASC LIMIT 1");
while ($row = mysql_fetch_assoc($result)) {
$l = $row['ID'];
}
$result = mysql_query("SELECT * FROM Categories ORDER BY ID ASC"); // ???
if (isset($l)){ // check if $l (the lowest number ID actually exists)
echo "<span style='font-size:100px;'>".$l."</span>";
echo "<input type='radio' name='ID' value='".$l."' />";
echo "<br />";
}
while ($row = mysql_fetch_assoc($result)) {
if($row['ID']>$l){
$l++;
echo "<br />";
echo "<span style='font-size:100px;'>".$l."</span>";
echo "<input type='radio' name='ID' value='".$l."' />";
echo "<br />";
}
echo $row['string']."<br /> <br /> ";
}
?>
<br />
<span style="font-size:100px;">(new category)</span>
<input type="radio" name="ID" value="<?php $h+=1; echo $h; ?>" />
<br /><br />
<input type="submit" value="Select category and submit" />
</div>
</form>
</body>
</html>
My way seems a bit messy. I did it with basically guess and check.