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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic connectivity between Perl & mySQL

Status
Not open for further replies.

carpeliam

Programmer
Mar 17, 2000
990
US
What's the basic protocol for connecting between Perl and mySQL? How might I execute an SQL statement?<br><br>Thanks.. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence."
 
It's a bit of a large subject to cover in detail...&nbsp;&nbsp;Take a look at the DBD and DBI modules.&nbsp;&nbsp;These provide perl with a standard interface to the many RDBMS packages out there.&nbsp;&nbsp;For example, MySQL, Oracle, Informix, and Postgres.<br><br>In a nutshell, there are several standard steps for extracting your data:<br><br>* Establish a connection to the database.<br>* Prepare your SQL statement.<br>* Execute the SQL statement.<br>* Retrieve and store the returned data.<br>* Close the SQL statement.<br><br>All of these are covered by the same commands regardless of which DBMS system you are using.&nbsp;&nbsp;The only things that need to change if you change your database are the DB module you are using, and maybe the initial command that connects to the database. <p> <br><a href=mailto: > </a><br><a href= > </a><br>--<br>
0 1 - Just my two bits
 
DBD and DBI modules?<br><br>I'm sorry, this is my first opportunity to program using a database, and so (other than knowing a bit of SQL and a bit of Perl) I'm completely clueless. I think that once you think you know a language fairly well, you should throw yourself out in new waters and become a newbie again. That's where I'm at. <p>Liam Morley<br><a href=mailto:lmorley@wpi.edu>lmorley@wpi.edu</a><br><a href=] :: imotic :: website :: [</a><br>"light the deep, and bring silence to the world.<br>
light the world, and bring depth to the silence.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top