Jump to content

why using DBI and not using DBD::mysql?

- - - - -

  • This topic is locked This topic is locked
3 replies to this topic

#1
nicoladinh

nicoladinh

    Newbie

  • Members
  • Pip
  • 1 posts
some said to me that i should use "use DBI;" instead of "use DBD::mysql;", and that DBD::mysql is kinda old stuff. but i don't really know the details why :c-blink:

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
I did a bit of searching and apparently DBI is a unifying superset of the various DBD modules that existed before, with some extra fun stuff.
sudo rm -rf /

#3
numberwhun

numberwhun

    Newbie

  • Members
  • Pip
  • 2 posts
Actually, to provide a bit of clarification, DBI is Perl's interface to the database world. while the "DBD::?????" (replace ???? with your database of choice that exists) are the drivers for DBI, instructing it how to interact with the database. DBD::mysql is actually supplied by default with Perl, so there should be nothing to do but provide the "use DBI;" statement at the beginning of your code and then use it accordingly.

Regards,

Jeff

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,722 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Hi, Jeff! Welcome to CodeCall. Please don't revive threads more than a few weeks old, as the people involved probably moved on quite a while ago, and it pushes newer threads with active users down in the new thread list. This thread is four months old. Don't worry, it's a very common newbie mistake. I did the same thing when I first joined CodeCall. :)

Happy coding!
-dargueta

Mod note: Thread closed.
sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users