Forum Moderators: phranque

Message Too Old, No Replies

Using mod dbd to access MySQL

         

csdude55

4:01 am on May 10, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Now I see that you can use .htaccess to read MySQL:

[httpd.apache.org...]

Using fastdbd could potentially be pretty awesome, since I use PHP to run the same MySQL query on every page. BUT, where this will only return one column, I would need to return 7 columns.

Before I give up on this, can you guys and gals suggest a way to use htaccess to return all 7 of those columns? Without doing 7 queries (one for each column), of course. My goal here would be to shave off a few microseconds of load time, and maybe take some stress off of the server.

phranque

12:42 pm on Jun 29, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



My goal here would be to shave off a few microseconds of load time, and maybe take some stress off of the server.

is there anything about using a db query here that serves that goal?

csdude55

6:38 pm on Jun 29, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I kinda forget my original idea, but on every page of the site I include (via PHP) a variables script that runs a MySQL query based on the domain name used (I have about 100 domains parked on the main one, and show data specific to each domain). I think that my idea was that if I could move that query to Apache then it wouldn't have to be ran on every page.

phranque

9:25 pm on Jun 29, 2020 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



where this will only return one column, I would need to return 7 columns.


you need 7 RewriteMap directives, one for each column.
if you use a MapType of fastdbd the queries will be made once upon server startup.

can you guys and gals suggest a way to use htaccess to return all 7 of those columns?

no.
according to the RewriteMap documentation:
... the MapSource is a SQL SELECT statement that takes a single argument and returns a single value.