Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

why using DBI and not using DBD::mysql?

mysql

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

#1 nicoladinh

nicoladinh

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 09 April 2011 - 09:44 AM

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:
  • 0

#2 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 12 April 2011 - 06:26 PM

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.
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'


#3 numberwhun

numberwhun

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 29 August 2011 - 10:50 PM

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
  • 0

#4 dargueta

dargueta

    I chown trolls.

  • Moderator
  • 4854 posts
  • Programming Language:C, Java, C++, PHP, Python, JavaScript, Perl, Assembly, Bash, Others
  • Learning:Objective-C

Posted 30 August 2011 - 09:07 AM

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.
  • 0

sudo rm -rf / && echo $'Sanitize your inputs!'