journal
all ![]() | Rob is 20,117 days old today. |
Jan 2008 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Mar 2008 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2007 jan feb mar apr may jun jul aug sep oct nov dec
2009 jan feb mar apr may jun jul aug sep oct nov dec |< << more >> >| |
Entries this day: Snow ctbriefs.net Snow 11:42am JST Sunday 3 February 2008 (day 13829)
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. permalinkctbriefs.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. permalinkprev day next day |