PDO and html-kit

  • Advertisement ( why? )
     

    sexymacman, 30th May 2015 6:19 am

    Any chance someone will create a plugin for PDO? Would also be awesome if html-kit could remotely access a mysql database :) Wishful thinking

    • bill, 30th May 2015 6:23 am

      On 5/30/2015 7:19 AM, sexymacman wrote:

      Any chance someone will create a plugin for PDO? Would also be awesome if

      html-kit could remotely access a mysql database :) Wishful thinking
      >
      To what end ? ie: why would you like to have kit access a database ?

      -bill

      • sexymacman, 30th May 2015 6:39 am

        database accessing is just wishful thinking, when I was using dreamweaver it let me access a database and i could change information on the fly and see the changes live.

        PDO support I know that its a lot of information, first a basic setup of the functions involved, and then in some way in the plugin it could remember what was setup like the database name password and host, and be able to generate the syntax based on the imputed values.

        like for example a PDO connect for mysql example

        username we will user htmlkittest
        password f986sfos
        database name we will use htmlkit
        host localhost

        and the variable to assign to it all $HTMLKIT

        once all the info is presented push enter and it inserts this

        $user="htmlkittest"
        $pass="f986sfos"
        database="htmlkit"
        $host="localhost"

        try {
        $HTMLKIT = new PDO("mysql:host=$host;dbname=$database", $user, $pass);
        }

        then separate dialog options for exceptions, prepared statements, select, insert, update queries, the options are endless.

        this is just a small example tho I know its a lot of information, I have look at the plugins I have and still trying to learn how to make my own, been on html-kit only for like a month. I couldn't use html-kit on my mac.

        • ginerjm, 7th Jul 2016 11:00 am

          Your example for 'having' a plugin for PDO is rather a moot reason. To establish a connection simply write one little module that takes care of that, using a function to pass any parameter (such as the db options, or the db name) values and put the userid and password needed in the code. If you don't happen to use the same sql userid and password for all of your dbs, include them as parms to the "connect' function when necessary. (I use one set of creds for all dbs. When they have to be changed, modifying my module takes care of it all in one place.)

          Now you simply include this 'connection' module at the top of any db-using script and you are done. Do you really need a plugin for such a one-time reason?