PERL - DBI Module(s)
PERL is capable of running SQL and MySQL queries including: inserts, selects, updates, deletes, etc through a module termed DBI. Often your web host will already have this module as well as DBD::mysql already installed. DBI stands for database interface. Any functions associated with DBI should work with all the available SQL platform including: SQL Server, Oracle, DB2, and MySQL.Before continuing, be sure the following modules are installed:
- DBI
- DBD::mysql
dbimodules.pl:
#!/usr/bin/perl # PERL MODULES WE WILL BE USING use DBI; use DBD::mysql;
PERL - DBI Config
We will be calling on our database, table, and host machine from time to time. We recommend setting up a some variables for your database and table name, so that you can call upon them as you wish throughout this brief tutorial. You may also set up some variables for your user name and password as we will also be needing to connect to your MySQL web host.dbiconfig.pl:
#!/usr/bin/perl # PERL MODULES WE WILL BE USING use DBI; use DBD::mysql; # DBI CONFIG VARIABLES $host = "localhost"; $database = "store"; $tablename = "inventory"; $user = "username"; $pw = "password";
0 comments:
Post a Comment