It'll Never Fly

Clever… not good, but clever.

CSS Tip: Uncollapsing Margins

In General on November 4th, 2004 by Bob
#
No Comments »

Eric Meyer has some tips on how to prevent margins from collapsing. Margin collapse always gives me a hard time. That, and floats, but I’m getting better.

“Best” is a Strong Word

In General on November 3rd, 2004 by Bob
#, #
3 Comments »

A Best Buy opened here in Regina earlier this week, and, unsurprisingly, it looks exactly like the other two Best Buys to which I’ve been. Buy, hey, another place to buy Mac stuff in town is a good thing. The DVD selection was quite good (likely a sign of the store still being new and having not been picked apart, yet), and the PS2 game library seemed varied.

I bought the Excel Saga: Perfect Collection and Zelda: Wind Waker.

Oh, and I bought a GameCube. That’s a landmark for me; the first time I’ve bought two different systems from the same generation.

Jaguar Death Watch #1

In General on November 3rd, 2004 by Bob
#
No Comments »

Yet another reason to upgrade to Panther (or eventually Tiger).

Storied Procedures

In General on November 3rd, 2004 by Bob
#
No Comments »

It’s a long story. I finally have stored procedures working in MySQL 5 and accessible through PHP 5. I’m running MySQLi 5.0.1a and PHP 5.0.2. Stored procedures work right out of the box in the MySQL frontend, but stored procedures that attempt to do a select through PHP give the error “SELECT in a stored procedure must have INTO.” Basically, you have to explicitly allow your MySQL client to let record sets be returned from a stored procedure call by specifying the “CLIENT_MULTI_RESULTS” flag as a parameter to the mysqli_real_connect method.

So where is that in PHP? Luckily, it’s a simple fix.

Note: you only need to do this if you require your stored procedures to return a recordset (i.e. a SELECT where you could get more than one row returned)

In ext/mysqli/mysqli.c, you have to add:

REGISTER_LONG_CONSTANT("MYSQLI_CLIENT_MULTI_RESULTS", CLIENT_MULTI_RESULTS, CONST_CS | CONST_PERSISTENT);

to the list of mysqli_real_connect flags, re-compile, and you’re done! I don’t see any reason why this hasn’t been included to begin with. I don’t believe it creates any kind of security hole like CLIENT_MULTI_STATEMENTS does. Presumably, you should be able to do the same if you’re using standard mysql instead.

Existing PHP code using mysqli_connect() will need to be changed to use mysqli_init() and mysqli_real_connect(), because only mysqli_real_connect() seems to allow one to specify the flag necessary for allowing stored procedures to return multiple results (MYSQLI_CLIENT_MULTI_RESULTS).

CSS Tip: Float Nearly Everything

In General on November 3rd, 2004 by Bob
#
No Comments »

Steve Smith has another strategy for how to clear floated elements.