httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Ingram <>
Subject APR DBD: Column names from query
Date Fri, 29 Aug 2008 16:38:49 GMT
Hi all,

First off, if this isn't the correct place to ask this then I apologise,
but it seemed the most appropriate list. If there's somewhere more
appropriate, please let me know.

I've had a quick look for some information on accessing a database via
APR, and after glancing through the header files, I still have a
question: is it possible to get the column names from the query results?

Most of the answers from a Google search were to do with the Perl DBD
system instead... maybe I'm just not looking for the right thing? I
would have guessed that searches along the lines of
> apr dbd "column names"
would have worked, but sadly they didn't give me anything useful.

I admit that I could perhaps get this information from an existing
module that uses DBD, although I'm not really sure where I should start
looking, as I don't know of any modules that would care about the actual
column names. I'm sure it shouldn't matter, but the target database
(initially) is MySQL, so I could always fall back to calling the MySQL
functions directly with the native handle given to me by DBD if I had to.

If you want some context, then the reason I want to fetch column names
is to use them as substitution patterns in a configuration file, for

<SQLRepeat "SELECT baz, bar, qux FROM sometable WHERE baz='foo'">
<VirtualHost *:80>
  DocumentRoot /www/root/path/$baz
  ServerName $bar
  ServerAdmin $qux

... which is a very rough-and-ready example, but hopefully illustrates
my reasons.



View raw message