[thelist] [SQL] tough concatenation

Joe Crawford jcrawford at avencom.com
Fri Apr 13 20:19:50 CDT 2001


rudy wrote:
> notice the absence of join conditions -- a full cartesian product
<mega-snips of mind-blowing SQL brilliance>




			rudy.ca is god





                                        - Joe <http://artlung.com/>



I definitely owe. This one I've been saving...

<tip subject="php auto-image thingy" provenance="http://artlung.com/">

The code below is a file you can use to quickly have a whole buncha
digital pictures turn into a semi-nice gallery. It's self contained, and
kinda nice.

Just save it as index.php (or index.php3) and drop it into a folder full
of jpegs and you have insta-gallery. No thumbnails, but a clean
presentation for the pictures.

It'd be nice if you could insta-slideshow, but I'm not that clever yet.

Oh, I have a semi-version at: http://www.artlung.com/amiga_pics/

And sorry, I had to include the "height" attribute of a table, so it
*nearly* validates. :-\

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html><head><title>a picture is worth a thousand words</title></head>
<body bgcolor="#ffffff">
<table width="100%" height="94%" border="0" cellspacing="0"
cellpadding="0">
<tr><td align="center">
<?php
if (!isset($i)) {
   $directory = "./";
   exec("ls -r $directory*.jpg", $contents);
   $i = 0;
   while (($contents[$i]))
      {
       echo "<a
href='./?i=$directory$contents[$i]'>$contents[$i]</a><br>\n";
       $i++;
      }
   $noback=1;
} elseif (is_file($i)) {
   $size = GetImageSize($i);
?>
<img src="<?php echo $i; ?>" <?php echo $size[3]; ?> alt="" border="5">
<?php } else { ?>
<p>there's something wrong here.<br>
unfortunately i'm a stupid program<br>
and i don't know what the problem is.<br><br>sorry.</p>
<?php } ?>
</td></tr>
<?php if ($noback==0) { ?>
<tr><td valign="bottom" align="center">
<small><a href="<?php echo $HTTP_REFERER; ?>">[ back ]</a></small>
</td></tr>
<?php }; ?>
</table>
</body>
</html>

</tip>




More information about the thelist mailing list