traincity has asked for the wisdom of the Perl Monks concerning the following question:

I have an operating web site which is basically perl driven with mysql. I am more familiar with php than perl and am wondering if I could read from mysql with php script while the site is operating. I'm not interested in writing to the database, only reading from it in php. Am I asking for trouble in doing this?

I have the same mysql database running locally on localhost and I am easily able to read from the database there. I've never tried this live and am a little concerned I may cause a problem. Thanks for any opinions!!

Replies are listed 'Best First'.
Re: Mixing PHP and Perl
by Your Mother (Archbishop) on Jun 27, 2019 at 01:14 UTC

    Shouldn’t be a problem, especially if the other code is only reading. Could maybe degrade performance depending on settings and allowed db clients and such but unless it’s a performance intensive application I doubt it would matter.

Re: Mixing PHP and Perl
by hippo (Archbishop) on Jun 27, 2019 at 17:28 UTC
    I'm not interested in writing to the database, only reading from it in php.

    In that case I would strongly recommend creating a DB user which has read-only privileges and use that in your PHP connection. That way you will mitigate most of the trouble which might otherwise occur.

    That said, reading from a database in Perl is pretty easy with DBI. Why not give it a try instead?