Re: How to access MySql using Perl. Help
I am new to MySql. I have MySql installed in my Linux PC. How do I connect to MySql using Perl script and assign the result of a query to an array? Where could I find a sample code? Thank you. man DBD::mysql Cheers. -- Luis Calero Muñoz $email{luis} = '[EMAIL PROTECTED]' $who{luis} = 'sysadm at ociojoven dot com' - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: How to access MySql using Perl. Help
http://www.hotscripts.com Or http://www.scriptsearch.com Both sites show examples on how to contect to a database with perl or PHP. They also show how to connect to other databases! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 3:11 AM To: Andy Cheng Cc: [EMAIL PROTECTED] Subject: Re: How to access MySql using Perl. Help I am new to MySql. I have MySql installed in my Linux PC. How do I connect to MySql using Perl script and assign the result of a query to an array? Where could I find a sample code? Thank you. man DBD::mysql Cheers. -- Luis Calero Muñoz $email{luis} = '[EMAIL PROTECTED]' $who{luis} = 'sysadm at ociojoven dot com' - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: How to access MySql using Perl. Help
Read through the man doc lcalero gave you it tells everything you need to know. Below is a basic example to help get you started: #!/usr/bin/perl use CGI; use DBI; $hostname = 'www.hostname.com'; $database = 'nameofdatabase'; $user = 'username'; $password = 'password'; $driver = 'mysql'; $dsn = DBI:$driver:database=$database;host=$hostname; my $dbh = DBI-connect($dsn, $user, $password) or die Cant connect to the DB: $DBI::errstr\n; my $sth = $dbh-prepare(SELECT attributes from entities); $sth-execute(); my $something; while (my @row = $sth-fetchrow_array()) { $something .= qq| $row[2]$row[1]etc.\n|; } #each row is respective to the row returned from the query with the first being row 0 $sth-finish; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 4:11 AM To: Andy Cheng Cc: [EMAIL PROTECTED] Subject: Re: How to access MySql using Perl. Help I am new to MySql. I have MySql installed in my Linux PC. How do I connect to MySql using Perl script and assign the result of a query to an array? Where could I find a sample code? Thank you. man DBD::mysql Cheers. -- Luis Calero Muñoz $email{luis} = '[EMAIL PROTECTED]' $who{luis} = 'sysadm at ociojoven dot com' - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How to access MySql using Perl. Help
Hi. You have to install DBI::DBD module. Then in perl use Mysql; $dbh = Mysql-connect(undef,database,username,'password'); $sql = select blah from blah; $sth = $dbh-query($sql); @arr = $sth-fetchrow; for example if the result is more than one line you have to loop it Ofcoz there is other ways to do it i guess:) /PM\ Andy Cheng wrote: Hello, I am new to MySql. I have MySql installed in my Linux PC. How do I connect to MySql using Perl script and assign the result of a query to an array? Where could I find a sample code? Thank you. Andy _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
How to access MySql using Perl. Help
Hello, I am new to MySql. I have MySql installed in my Linux PC. How do I connect to MySql using Perl script and assign the result of a query to an array? Where could I find a sample code? Thank you. Andy _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
How to access MySql using Perl. Help
Hello, I am new to MySql. I have MySql installed in my Linux PC. How do I connect to MySql using Perl script and assign the result of a query to an array? Where could I find a sample code? Thank you. Andy _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How to access MySql using Perl. Help
Hi. You have to install DBI::DBD module. Then in perl use Mysql; $dbh = Mysql-connect(undef,database,username,'password'); $sql = select blah from blah; $sth = $dbh-query($sql); @arr = $sth-fetchrow; for example if the result is more than one line you have to loop it Ofcoz there is other ways to do it i guess:) /PM\ Andy Cheng wrote: Hello, I am new to MySql. I have MySql installed in my Linux PC. How do I connect to MySql using Perl script and assign the result of a query to an array? Where could I find a sample code? Thank you. Andy _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
How to get connected with mysql using perl scripts
Hi all, Please guide me to get the connection with mysql through perl scripts and through the scripts i have to insert some lot of data in the existing tables. Thank you. Regards, Charitha. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How to get connected with mysql using perl scripts
Hi, Check the following links: http://dbi.symbolstone.org/ http://www.saturn5.com/~jwb/dbi-examples.html http://www.oreilly.com/catalog/perldbi/ Best of luck. ~ SubbaReddy .M E-mail: [EMAIL PROTECTED] W3Page: http://www.geocities.com/msubbareddy/ ICQ: 56093095 - Original Message - From: Charitha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 30, 2002 1:51 PM Subject: How to get connected with mysql using perl scripts Hi all, Please guide me to get the connection with mysql through perl scripts and through the scripts i have to insert some lot of data in the existing tables. Thank you. Regards, Charitha. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How to get connected with mysql using perl scripts
And here some more good links for DBI: http://www.he.net/adm/mysql/chapter7.html http://www.he.net/adm/mysql/chapter6.html ~ SubbaReddy .M Sr. Programmer, Frontlinesoft, Hyderabad ( http://www.frontlinesoft.com ) Ph: 91-40-3392147, 3391683 w3doc: http://www.geocities.com/msubbareddy/ ICQ: 56093095 From: SubbaReddy M [EMAIL PROTECTED] To: Charitha [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, January 30, 2002 3:42 PM Subject: Re: How to get connected with mysql using perl scripts Hi, Check the following links: http://dbi.symbolstone.org/ http://www.saturn5.com/~jwb/dbi-examples.html http://www.oreilly.com/catalog/perldbi/ Best of luck. ~ SubbaReddy .M E-mail: [EMAIL PROTECTED] W3Page: http://www.geocities.com/msubbareddy/ ICQ: 56093095 - Original Message - From: Charitha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 30, 2002 1:51 PM Subject: How to get connected with mysql using perl scripts Hi all, Please guide me to get the connection with mysql through perl scripts and through the scripts i have to insert some lot of data in the existing tables. Thank you. Regards, Charitha. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
How to get connected with mysql using perl scripts
Charitha, Wednesday, January 30, 2002, 10:21:11 AM, you wrote: C Hi all, C Please guide me to get the connection with mysql through perl scripts and C through the scripts i have to insert some lot of data in the existing C tables. You can refer to: http://www.mysql.com/downloads/api-dbi.html C Regards, C Charitha. -- For technical support contracts, goto https://order.mysql.com/ This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: How to get connected with mysql using perl scripts
Hi, see the DBI perldoc here is a quick example: my $dbh = DBI-connect(DBI:mysql:mydb, $user, $password) or die Can't connect to $data_source: $DBI::errstr; Charitha wrote: Hi all, Please guide me to get the connection with mysql through perl scripts and through the scripts i have to insert some lot of data in the existing tables. Thank you. Regards, Charitha. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- Colin Faber (303) 859-1491 fpsn.net, Inc. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Problem in connecting to mysql using perl
Dear Sir, I have downloaded DBI-1.15. I tried installing it. The tests failed. I am using PMAKE to prepare an install program. The error is as follows: can't locate loadable object for module DBI in @INC. I am also providing you with the procedure i adopted to install DBI step 1: I checked my perl version. It is active-state perl 5.6.0 step 2: I gave the command pmake makefile.pl err:can't 'MAKE', - no target makefile.pl at Make.pm line 1164. step 3: On command pmake pro: Reading Make.pm Reading /..makefile ... err: The name specified is not recognized as an internal or an external command, operable program or batch file. step 4: On command pmake test pro: Reading Make.pm Reading /..makefile ... err: The name specified is not recognized as an internal or an external command, operable program or batch file. Please tell me where I am wrong. Is there any setup kit, so that I can install the DBI module easily. With this, I also request you to give a suggession to connect to mySQL without using DBI. Can I connect to mySQL database using win32::ODBC. If yes, please give me code details on how to connect using this. waiting for a positive response, -harish
Re: MYSQL using PERL
Rajeev Ramanujan wrote: Hai, I am using Red Hat Linux 7. From where can I get example programmes of connectiong to MYSQL using PERL under Linux. Thankyou Rajeev Ramanujan Look at any of the perl based packages or utilities listed in the contributed section at mysql.com. One of the best ways to learn a new language is to study someone elses programs. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: MYSQL using PERL
How about mysql.com, http://cpan.org/modules/by-module/DBI/ MySQL.com has numerous links to help documents and code samples. -- === "If you put three drops of poison into a 100 percent pure Java, you get - Windows. If you put a few drops of Java into Windows, you still have Windows." -- Sun Microsystems CEO, Scott McNealy __ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: MYSQL using PERL
Buy the MySQL book from New Riders. You won't be disappointed. -- === "If you put three drops of poison into a 100 percent pure Java, you get - Windows. If you put a few drops of Java into Windows, you still have Windows." -- Sun Microsystems CEO, Scott McNealy __ Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/ - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
MYSQL using PERL
Hai, I am using Red Hat Linux 7. From where can I get example programmes of connectiong to MYSQL using PERL under Linux. Thankyou Rajeev Ramanujan
Re: MYSQL using PERL
Hi, Have you installed DBI/DBD?? if so you can perldoc DBI or perldoc mysql_dbd to read the manual. Alan. Hai, I am using Red Hat Linux 7. From where can I get example programmes of connectiong to MYSQL using PERL under Linux. Thankyou Rajeev Ramanujan -- Åwªï¨Ï¥ÎHongKong.com¶l¥ó¨t²Î Thank you for using hongkong.com Email system - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php