Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Wednesday, August 03, 2011

Quite possibly the geekiest thing I'll post. Ever...

Quite possibly the geekiest post I will post all year... but I was bored... tea-making-a-la-partial-PHP-mySQL. I have coding on the brain.


$result = mysql_query("SELECT mug,teabag,goats_milk,teaspoon FROM kitchen_cupboard WHERE `owner`='dolidh'",$db) or die(mysql_error());
if (mysql_num_rows($result)) {
foreach (mysql_fetch_assoc($result) as $key => $value) {
$$key = $value;

}

$hotwater=boilkettle(water);
$fillmug=$mug.'with'.(​$teabag+$hotwater;)
$stirred_tea=($teaspoon+(stir($​fillmug)))-($teaspoon+$teabag);
$milkytea=$stirred_​tea+$goats_milk;
$dolidhs_tea=($teaspoon+(stir($mil​kytea)))-$teaspoon;
sleep(3600);
header(location:mak​emoretea);
}


Kai's found a way of over-riding my tea script for his own gains (so I make him a cup too).... he refreshed the page.... teascript V2 will include a mySQL check to check the datetime that it has actually been an hour since the last cup. Possibly a digestive biscuit include :P