journal
all all entries rss SoML excited dreams runes YRUU ultimate KTRU skate sleepy nihongo
Rob is 20,117 days old today.
prev day next day printable version

Entries this day: Snow ctbriefs.net

Snow

11:42am JST Sunday 3 February 2008 (day 13829)

Ami and Francois and snow It snowed for a lot of the day today. The temp was just around 0 to 1 degree C, so the snow was blucky mushy messy mush. This pic was taken as Ami and I walked to the grocery store near Hirama station to get some veggies and stuff for foodage today. Francois hadn't seen snow before, so he was quite excited, I'm sure. Somehow he was able to sit long enough for the pictures.

Other snow pictures are available on my site, though they are nothing much to see. Ami asked if it snows in Texas, so I dutifully explained that Texas is way bigger than Japan, etc, and she shifted her question to ask about Houston. Perhaps I should be more forgiving of this type of question, but I used to get them all the time in class. "Is Texas hot?" "What is Texas like?" or the bane of my career as an English teacher in Japan: "ooooh cowboy!"

Sorry; got a little sidetracked there. So, um, yeah, so we went shopping and loaded almost everything into my backpack, probably saving two bags for the earth. Got a box of 6 bottles of water instead of just one because it was easy enough to carry them home since I wasn't on TJ Bike.

Was going to try to get a pic of my sliding down the bicycle ramp in the middle of the steps, but my camera battery died. Probably just as well cause I still don't have health insurance and such silly antics could lead to a broken body part. At least we would have gotten it on video for youtube.

permalink

ctbriefs.net

11:53pm JST Sunday 3 February 2008 (day 13829)

I've got the sort worked out... I think I may have mentioned that last night. Today I got the core of the pagination worked out. I know how many records are in the original query, discounting the LIMIT clause.

For the sake of free software, here is code for using mysqli to get number of rows with limit: (this code is snipped out of the middle of a method in my object, so it will require some changes around the $this-> parts.)

		$query = "SELECT SQL_CALC_FOUND_ROWS * FROM theories as t left join users as u using(uid) " .
			{$where_clause} . 
			"LIMIT " . $min .  ", " . $per_page;

		if($statement = $this->mysqli->prepare($query))
		{
		
			$statement->bind_param("dd", $var, $var2);
			$statement->execute();
			$statement->bind_result(<snip>);
			while ($statement->fetch())
			{
			    stuff;
			}
			$statement->close();


			$statement=$this->mysqli->prepare("Select FOUND_ROWS()");
			$statement->execute();
			$statement->bind_result($num_records);
			$statement->fetch();
		
			$num_pages = ceil($num_records / $_SESSION['theories_per_page']);
			
			print_rob($num_records, "num records");
			print_rob($num_pages, "num pages");
		}

1:02am JST Monday 4 February 2008 (day 13830)

Ah, cool. Now I know how to send the user's choice to the program. Now I just need to get the current DB query to feed back to the UI which page of how many they are on.

permalink
prev day next day