Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stupid Newbie question about mySQL and Perl

Status
Not open for further replies.

Eloff

Programmer
Aug 29, 2001
78
0
0
CA
I understand you can do a command like

create table "table name" ("colname" "coltype","colname2" "coltype2");

simple SQL command. Now how do you make usch a command from your perl script? I get the drift that one uses perl to put the power into simple sql statements. If you could just show me how to do this I'd appreciate it. It's probably something ludicrously simple, but it still baffles me. Favorite quote Narf
Age: 17
School: Alberta Distance Learning Center
Location: British Columbia, Canada
If at first you can't succeed, try, try again. - programmer's motto.
 
Hi there Nightmare,

You need to have a few things in place first:

You need a way to talk to the database - a good way is DBI.

Do you have DBI installed?

You also need a driver for MySQL - this must be installed as well.

To check that these are installed try the following script.

use DBI;
use DBD::MySQL;

If it runs without any errors they are installed ok. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Okay I recieved an error running that, so it is not installed. How do I instal DBI? Favorite quote Narf
Age: 17
School: Alberta Distance Learning Center
Location: British Columbia, Canada
If at first you can't succeed, try, try again. - programmer's motto.
 
Okay I downloaded DBI from perl.com, but I haven't the faintest idea how to instal it. Their readme is for people who actually know what they are doing, and that counts me out right away. Favorite quote Narf
Age: 17
School: Alberta Distance Learning Center
Location: British Columbia, Canada
If at first you can't succeed, try, try again. - programmer's motto.
 
What platform are you on?

On Linux, the install is pretty simple - something like:

# perl Makefile.PL (I think this is right)
# make
# make test
# make install (do this as root)

You should find similar instructions in the DBI "INSTALL" or "README" file - there's a lot of other stuff as well, but that's the meat of the commands you need to execute.

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
I'm on linux, virtual hosting package. Now i read that in the readme but you have to understand I'm very new to this. I have no clue what that means, perl Makefile.pl? sounds like something typed into a command line. What command line? There are tons of files in the DBI::mysql archive and tons of files in the DBI archive that I downloaded. Where do I put them? do I keep the subdirectories? I need lots of help with this one! Favorite quote Narf
Age: 17
School: Alberta Distance Learning Center
Location: British Columbia, Canada
If at first you can't succeed, try, try again. - programmer's motto.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top