RE: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Mimi Cafe
er 2010 07:37 => To: beginners@perl.org => Subject: PERL MYSQL query "IF EXISTS then UPDATE else INSERT" => => Hello, => => I want to update my database if the key value is already there then it => will => update the required field else it will insert the new row in the sa

Re: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Peter Scott
On Wed, 20 Oct 2010 12:07:03 +0530, S Pratap Singh wrote: > I want to update my database if the key value is already there then it > will update the required field else it will insert the new row in the > same table. > > Insert query works fine but I am not able to figure out how to achieve > this

Re: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Chris Knipe
Just use SQL? INSERT INTO tbl, VALUES ('11','22','33') ON DUPLICATE KEY http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html On Wed, Oct 20, 2010 at 9:23 AM, Uri Guttman wrote: > > "SPS" == S Pratap Singh writes: > > > SPS> Insert query works fine but I am not able to f

Re: PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-20 Thread Uri Guttman
> "SPS" == S Pratap Singh writes: SPS> Insert query works fine but I am not able to figure out how to SPS> achieve this "IF EXISTS then UPDATE else INSERT" using a one SPS> liner MYSQL statement . If someone can give me an example to SPS> write such query and execute it from perl the

PERL MYSQL query "IF EXISTS then UPDATE else INSERT"

2010-10-19 Thread S Pratap Singh
Hello, I want to update my database if the key value is already there then it will update the required field else it will insert the new row in the same table. Insert query works fine but I am not able to figure out how to achieve this "IF EXISTS then UPDATE else INSERT" using a one liner MYSQL

Re: perl-mysql...

2007-07-25 Thread [EMAIL PROTECTED]
uld be able to get your data out using a simple sql query and then > display it accordingly.-Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 25 July 2007 13:34 > To: [EMAIL PROTECTED] > Subject: perl-mysql... > > Hi All, > I have

Re: perl-mysql...

2007-07-25 Thread Prabu Ayyappan
Hi Rupesh, Can you explain your problem scenario a little more briefly. So that it may help in understanding the problem clearly, For Example, My input is like I am expecting this output. What you tried to achieve your output.. Regards, Prabu "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:

RE: perl-mysql...

2007-07-25 Thread Andrew Curry
You should be able to get your data out using a simple sql query and then display it accordingly. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 25 July 2007 13:34 To: beginners@perl.org Subject: perl-mysql... Hi All, I have this problem of

perl-mysql...

2007-07-25 Thread [EMAIL PROTECTED]
Hi All, I have this problem of appending data from MySQL database to the output html page on the browser. The output on the browser in the html format looks like this : Probe1 Probe2 r-valuep-value e-value 1234 45671.

Perl/MySQL Email Newsletter

2006-12-13 Thread Nigel Peck
Hi, I need to setup an email newsletter system in Perl/MySQL. I had a look around and couldn't see any open source software that fits the bill. Any suggestions? If I was to write it myself, what's the best way to seup a Perl script to accept and handle incoming emails?

Re: Perl-mysql

2006-08-30 Thread jm
On 8/30/06, Manne, Siva Chaitanya Prasad <[EMAIL PROTECTED]> wrote: Hi, I would like to connect to a database stored at linux machine from my Windows machine. But I am unable to connect to the mysql server. The error I am getting is "DBI connect('employee:xxx.xxx.xxx.xx','root

Perl-mysql

2006-08-30 Thread Manne, Siva Chaitanya Prasad
Hi, I would like to connect to a database stored at linux machine from my Windows machine. But I am unable to connect to the mysql server. The error I am getting is "DBI connect('employee:xxx.xxx.xxx.xx','root',...) failed: Unknown MySQL server host 'xxx.xxx.xxx.xx' (11001) at

Re: Perl-mysql

2006-08-30 Thread jm
first, sharing the error message you get when trying to connect will help isolate the actual cause of the problem. second, getting rid of all the extraneous whitespace in your code fragment will help in reading the code. as for possible causes of the error: 1. DBI->connect syntax may be incorre

Perl-mysql

2006-08-30 Thread Manne, Siva Chaitanya Prasad
Hi, I would like to connect to a database stored at linux machine from my Windows machine. But I am unable to connect to the mysql server. Please help me regarding this issue.

IDE for web pages produces by Perl/MySql

2004-10-10 Thread Mike K
G'day... I'm wanting to use Perl with MySQL to produce web pages, and then process the results. Are there any IDEs (like PageMill, Dreamweaver, etc) that understand Perl or can write templates that Perl can understand using a particular package? All help appreciated. Thanks Mike (Please reply-

RE: perl mysql question

2004-04-27 Thread Christopher Lyon
Thanks, That did it! > -Original Message- > From: Daniel Staal [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 27, 2004 11:36 AM > To: Perl Beginners > Subject: RE: perl mysql question > > --As of Tuesday, April 27, 2004 8:30 AM -0700, Christopher Lyon is a

RE: perl mysql question

2004-04-27 Thread Daniel Staal
--As of Tuesday, April 27, 2004 8:30 AM -0700, Christopher Lyon is alleged to have said: while ( @array = $sth->fetchrow_array() ) { print "$array[1] -> $array[3]\n"; $table{ "$array[1]" } = "$array[3]"; } my @keys = keys( %table ) ; while ( $key = pop( @keys ) ) { print "

RE: perl mysql question

2004-04-27 Thread Christopher Lyon
> -Original Message- > From: Daniel Staal [mailto:[EMAIL PROTECTED] > Sent: Monday, April 26, 2004 8:54 PM > To: Perl Beginners > Subject: Re: perl mysql question > > --As of Monday, April 26, 2004 5:30 PM -0700, Christopher Lyon is alleged > to have said: >

RE: perl mysql question

2004-04-27 Thread Bob Showalter
Christopher Lyon wrote: > Not sure if I should post this to beginners or not but there it goes. > > I have 10+ tables with some of the same information in each in table > of a mysql database. Here is an example: > [snip] > > I need to take the names and add the counts up for between each table >

Re: perl mysql question

2004-04-26 Thread Randy W. Sims
On 4/26/2004 11:53 PM, Daniel Staal wrote: --As of Monday, April 26, 2004 5:30 PM -0700, Christopher Lyon is alleged to have said: So, how to I get the values to look like in variable so that I can push them back into a new table: New Table namecount -+--- Widgets-A|25 Wi

Re: perl mysql question

2004-04-26 Thread Daniel Staal
--As of Monday, April 26, 2004 5:30 PM -0700, Christopher Lyon is alleged to have said: So, how to I get the values to look like in variable so that I can push them back into a new table: New Table namecount -+--- Widgets-A| 25 Widgets-B| 10 Widgets-C| 20 Wi

perl mysql question

2004-04-26 Thread Christopher Lyon
Not sure if I should post this to beginners or not but there it goes. I have 10+ tables with some of the same information in each in table of a mysql database. Here is an example: Table 1 namecount -+--- Widgets-A| 10  Widgets-B| 5 Widgets-C| 10 Widgets-D

Re: Perl & Mysql

2003-12-07 Thread Robert
Wiggins D'Anconia wrote: Vim is better than emacs, PHP is better than Perl, Red Hat is better than Suse, Gentoo is better than Debian, Gnome is better than KDE, Linux is better than Windows, Java is better than C++, MySQL is better than PgSQL I have heard these discussions before, no one ever seems

Re: Perl & Mysql

2003-12-07 Thread Robert
Randal L. Schwartz wrote: "Wiggins" == Wiggins D'Anconia <[EMAIL PROTECTED]> writes: Wiggins> But what are the reasons for choosing PostgreSQL over MySQL? What's a Wiggins> "real" database? Without providing reasons this is just FUD. I will Wiggins> agree that if you are looking for a package

Re: Perl & Mysql

2003-12-07 Thread Wiggins d'Anconia
Randal L. Schwartz wrote: "Wiggins" == Wiggins D'Anconia <[EMAIL PROTECTED]> writes: Wiggins> But what are the reasons for choosing PostgreSQL over MySQL? What's a Wiggins> "real" database? Without providing reasons this is just FUD. I will Wiggins> agree that if you are looking for a package

Re: Perl & Mysql

2003-12-06 Thread Randal L. Schwartz
> "Wiggins" == Wiggins D'Anconia <[EMAIL PROTECTED]> writes: Wiggins> But what are the reasons for choosing PostgreSQL over MySQL? What's a Wiggins> "real" database? Without providing reasons this is just FUD. I will Wiggins> agree that if you are looking for a package closer to a "real Wig

Re: Perl & Mysql

2003-12-06 Thread Wiggins d'Anconia
Randal L. Schwartz wrote: "Dan" == Dan Muey <[EMAIL PROTECTED]> writes: Which modules i have to install in order to connect perl with mysql ?, in what order ?, My perl Dan> Excellent choice of combo! I disagree. The only reason to choose MySQL over PostgreSQL these days is compatibility with

Re: Perl & Mysql

2003-12-06 Thread Randal L. Schwartz
> "Dan" == Dan Muey <[EMAIL PROTECTED]> writes: >> Which modules i have to install in order to connect >> perl with mysql ?, in what order ?, My perl Dan> Excellent choice of combo! I disagree. The only reason to choose MySQL over PostgreSQL these days is compatibility with an existing bolt

Re: Perl & Mysql

2003-12-06 Thread Bryan Harris
> Which modules i have to install in order to connect > perl with mysql ?, in what order ?, My perl > installation is on solaris 9. I already have mysql > installed. Thanks for the help. Here's what I wrote up while installing under OS X, should be pretty similar: > To install perl support f

RE: Perl & Mysql

2003-12-05 Thread Dan Muey
> Hi there, > Howdy, >Which modules i have to install in order to connect > perl with mysql ?, in what order ?, My perl Excellent choice of combo! You'll want to install DBI It should come witht the mysql driver automatically. > installation is on solaris 9. I already have mysql > instal

Perl & Mysql

2003-12-05 Thread Joe Echavarria
Hi there, Which modules i have to install in order to connect perl with mysql ?, in what order ?, My perl installation is on solaris 9. I already have mysql installed. Thanks for the help. Joe Echavarría. __ Do you Yahoo!? Free Pop-Up Blocker - Get it n

Re: perl @ mysql

2003-09-20 Thread Wiggins d'Anconia
Todd W. wrote: RTFM for the HandleError property of DBI objects: http://search.cpan.org/author/TIMB/DBI-1.38/DBI.pm#DBI_Utility_Functions Scroll down to $h->{HandleError}... You can set it to a code ref that is called when a DBI exception is thrown. Read the docs very carefully, you can desig

Re: perl @ mysql

2003-09-17 Thread Todd W.
"Wiggins D'Anconia" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > > On Wed, 17 Sep 2003 12:49:28 -0400, Dan Anderson <[EMAIL PROTECTED]> wrote: > > > Do you mean that you set a debug bool at the beginning of the file and > > if (ma

RE: perl @ mysql

2003-09-17 Thread Wiggins d'Anconia
On Wed, 17 Sep 2003 12:49:28 -0400, Dan Anderson <[EMAIL PROTECTED]> wrote: > Do you mean that you set a debug bool at the beginning of the file and > if (main::$debug) { spit_out_error(); } or you just don't output errors > at all? Doesn't that m

RE: perl @ mysql

2003-09-17 Thread Dan Anderson
Do you mean that you set a debug bool at the beginning of the file and if (main::$debug) { spit_out_error(); } or you just don't output errors at all? Doesn't that make debugging much harder? -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: perl @ mysql

2003-09-17 Thread Wiggins d'Anconia
On Wed, 17 Sep 2003 09:48:31 +0200, peter grotz <[EMAIL PROTECTED]> wrote: > Hi, > > I wanna use a mysql-database for our systemuser-management. > Adding and showing a list of users is no problem but now my question: > > How can I handle the appe

RE: perl @ mysql

2003-09-17 Thread Dan Muey
> Hi, Howdy > > I wanna use a mysql-database for our systemuser-management. > Adding and showing a list of users is no problem but now my question: > > How can I handle the appearing mysql-errorcode instead of the > "die"-statement when I´m selecting or deleting a nonexisting Assuming I und

perl @ mysql

2003-09-17 Thread peter grotz
Hi, I wanna use a mysql-database for our systemuser-management. Adding and showing a list of users is no problem but now my question: How can I handle the appearing mysql-errorcode instead of the "die"-statement when I´m selecting or deleting a nonexisting entry in my database? Thanks in advanc

RE: Perl & MySQL (SELECT)

2002-11-22 Thread wiggins
On Fri, 22 Nov 2002 11:56:44 -0600, "Mariusz" <[EMAIL PROTECTED]> wrote: > A while ago I asked for help on the following: > > > I would like to be able to select records from the a table where record_id > > and $record_id from my @record_ids match

Perl & MySQL (SELECT)

2002-11-22 Thread Mariusz
A while ago I asked for help on the following: > I would like to be able to select records from the a table where record_id > and $record_id from my @record_ids matches. I know I could go through a loop > and send a SELECT query for each element in the array but is there a better > way? How can I

RE: perl & MySQL

2002-11-12 Thread wiggins
Build the "where" portion of your query dynamically with a whole bunch of "or"s. my $where = '('; for (@record_ids) { $where .= " OR " if ($where ne '('); $where .= "(record_id='$_')"; } $where .= ')'; $select = "SELECT * FROM a WHERE $where"; You get the idea. http://danconia.org ---

Re: perl & MySQL

2002-11-12 Thread david
Mariusz wrote: > I would like to be able to select records from the a table where record_id > and $record_id from my @record_ids matches. I know I could go through a > loop and send a SELECT query for each element in the array but is there a > better way? How can I accomplish the same but only sen

RE: perl & MySQL

2002-11-12 Thread Nigel Peck - MIS Web Design
usz [mailto:mkubis22@;hotmail.com] Sent: 12 November 2002 17:34 To: perl Subject: perl & MySQL I would like to be able to select records from the a table where record_id and $record_id from my @record_ids matches. I know I could go through a loop and send a SELECT query for each element in the array b

Re: perl & MySQL

2002-11-12 Thread Paul
--- Mariusz <[EMAIL PROTECTED]> wrote: > I would like to be able to select records from the a table where > record_id and $record_id from my @record_ids matches. I know I could > go through a loop and send a SELECT query for each element in the > array but is there a better way? How can I accompli

perl & MySQL

2002-11-12 Thread Mariusz
I would like to be able to select records from the a table where record_id and $record_id from my @record_ids matches. I know I could go through a loop and send a SELECT query for each element in the array but is there a better way? How can I accomplish the same but only sending one query? than

RE: Perl / MySQL Question

2002-11-11 Thread wiggins
>From the MySQL docs: If you delete the row containing the maximum value for an AUTO_INCREMENT column, the value will be reused with an ISAM, or BDB table but not with a MyISAM or InnoDB table. If you delete all rows in the table with DELETE FROM table_name (without a WHERE) in AUTOCOMMIT mode,

Perl / MySQL Question

2002-11-11 Thread Jessee Parker
In my script, I do the following: I insert x amount of records into a MySQL table, process the information and then delete those records. One of the columns is an autonumber type so it starts at 1 for instance. In my query string I use placeholders. Now sometimes the field which is an autonumber st

Re: Perl & MySQL

2002-09-23 Thread david
Dan wrote: > right, i've had a look into sql and everything, and kinda got to grasp > with how it works, i've written a trial script to see if it works, but it > keeps spewing an error: > > DBI->connect(mx:localhost:3306) failed: Access denied for user: > 'dan@localhost' (Using password: YES) at

Re: Perl & MySQl query syntax

2002-09-23 Thread Felix Geerinckx
on Sun, 22 Sep 2002 17:53:29 GMT, Wiggins D'Anconia wrote: > larry lefthook wrote: >> my $sth = $dbh->prepare('delete from cl_items WHERE date_time < >> $exp_time2 '); >> > > You are single quoting your statement which means $exp_time2 is taken > literally rather than interpolated should be:

Re: Perl & MySQL

2002-09-23 Thread wiggins
MySQL is complaining about the user "dan" not existing in the database. You need to add a record to the mysql:users table for each user you wish to connect to the database as. MySQL stores all of its permissions stuff as database tables so normal INSERT and UPDATE statements will work, but y

Re: Perl & MySQL

2002-09-23 Thread dan
right, i've had a look into sql and everything, and kinda got to grasp with how it works, i've written a trial script to see if it works, but it keeps spewing an error: DBI->connect(mx:localhost:3306) failed: Access denied for user: 'dan@localhost' (Using password: YES) at db.pl line 10 Can't con

Re: Perl & MySQl query syntax

2002-09-22 Thread Wiggins d'Anconia
larry lefthook wrote: > Hi! What's the right syntax using a variable with Perl & MySQL query? > I got an example for PHP: > #$exp_time = time()-86400; > #$query = "DELETE FROM cl_temp_users WHERE sign_up_date < $exp_time;" ; > But with Perl it does not work

Perl & MySQl query syntax

2002-09-22 Thread larry lefthook
Hi! What's the right syntax using a variable with Perl & MySQL query? I got an example for PHP: #$exp_time = time()-86400; #$query = "DELETE FROM cl_temp_users WHERE sign_up_date < $exp_time;" ; But with Perl it does not work, like I have tried below. How to put my $sth l

Re: Perl & MySQL

2002-09-21 Thread Wiggins d'Anconia
First off for those MySQL newbies in the crowd you might find this helpful, I compiled it a while ago but I am pretty sure it is still accurate: http://www.residualselfimage.com/mysql_pkt_ref/ Essentially you need to start with the mysql documentation, or a beginners guide on that, then check

Perl & MySQL

2002-09-21 Thread dan
I'm in the process of writing IRC Services in Perl. I know most of you won't know anything about IRC in this aspect at least. However what I need help with is being able to store the services' data in a MySQL database. I know absolutely nothing about MySQL. At the moment it's using a flat text fil

Re: Perl / MySQL problem

2002-05-14 Thread Felix Geerinckx
on Tue, 14 May 2002 18:57:56 GMT, Jim-Cont Flaherty wrote: > while( $questions_asked =~ /!([^!]*)/g) { > > my $num1 = $1; > > > print " This is a test: $num1"; # this statement for debug > > my $sth1 = $dbh -> prepare("select * from tests where num = '$num1' > "); > > $sth1

Perl / MySQL problem

2002-05-14 Thread FLAHERTY, JIM-CONT
Does anyone have an Idea whats going on here , I have an array feeding a SQL Query, But it doesnt always come back with a success . What this query does it is on a Quiz web site . Students take quiz, variable is passed to grade.cgi. that variable is parsed with a while statement. and a variable

Re: perl+MySql+form

2002-01-31 Thread Kilaru Sambaiah
On Thursday 31 January 2002 02:43 pm, katta ananta mohan wrote: > Dear all, > I need to know how to link a MySqldatabase on to a web interface > like a HTML-form with perl programming .basically I need to retrieve data > from the database onto the webinterface by using search methods.I'd

perl+MySql+form

2002-01-31 Thread katta ananta mohan
Dear all, I need to know how to link a MySqldatabase on to a web interface like a HTML-form with perl programming .basically I need to retrieve data from the database onto the webinterface by using search methods.I'd appreciate if U provide me with some useful links regarding the same

Re: sample customer dbms in perl/mysql

2002-01-19 Thread zentara
On Fri, 18 Jan 2002 15:40:39 -0500, [EMAIL PROTECTED] (William Ampeh) wrote: >I have just been asked to come up with Perl/Mysql demo on Monday. >Considering the short notice, I was wondering if anyone can point me to a >freeware >WEB-base database system implemented in Perl and M

RE: sample customer dbms in perl/mysql

2002-01-19 Thread Gary Hawkins
ginal Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 18, 2002 12:41 PM > To: [EMAIL PROTECTED] > Subject: sample customer dbms in perl/mysql > > > Hello, > > I have just been asked to come up with Perl/Mysql demo on Monday. > Consi

RE: sample customer dbms in perl/mysql

2002-01-18 Thread Chris Spurgeon
, January 18, 2002 3:41 PM To: [EMAIL PROTECTED] Subject: sample customer dbms in perl/mysql Hello, I have just been asked to come up with Perl/Mysql demo on Monday. Considering the short notice, I was wondering if anyone can point me to a freeware WEB-base database system implemented in Perl and

sample customer dbms in perl/mysql

2002-01-18 Thread William.Ampeh
Hello, I have just been asked to come up with Perl/Mysql demo on Monday. Considering the short notice, I was wondering if anyone can point me to a freeware WEB-base database system implemented in Perl and Mysql. Thank you. __ William Ampeh (x3939) Federal Reserve Board

Re: PERL MySQL DBI

2001-12-07 Thread Daniel Gardner
Friday, December 07, 2001, 5:18:38 AM, Aaron Shurts wrote: AS> Okay, I was the one that asked the crazy question about the weird join, AS> but I got that figured out. Now I have a problem. AS> while( ($login, $existingemail, $areacode, $prefix, $rest) = $sth->>fetchrow_array ()) AS> { AS>

Re: PERL MySQL DBI

2001-12-06 Thread Maxim Berlin
Hello Aaron, Friday, December 07, 2001, Aaron Shurts <[EMAIL PROTECTED]> wrote: AS> Okay, I was the one that asked the crazy question about the weird join, AS> but I got that figured out. Now I have a problem. AS> while( ($login, $existingemail, $areacode, $prefix, $rest) = $sth->>fetchrow_arr

RE: PERL MySQL DBI

2001-12-06 Thread Gibbs Tanton - tgibbs
try to do that. -Original Message- From: Aaron Shurts To: [EMAIL PROTECTED] Sent: 12/6/2001 11:18 PM Subject: PERL MySQL DBI Okay, I was the one that asked the crazy question about the weird join, but I got that figured out. Now I have a problem. while( ($login, $existingemail, $areacode,

PERL MySQL DBI

2001-12-06 Thread Aaron Shurts
Okay, I was the one that asked the crazy question about the weird join, but I got that figured out. Now I have a problem. while( ($login, $existingemail, $areacode, $prefix, $rest) = $sth->fetchrow_array ()) { print "$login,$existingemail,$areacode-$prefix-$rest\n"; } That code

Win 98 SE; Apache; Perl; MySQL

2001-11-19 Thread Rob Benjamin
I'm trying to set up my Win98 SE system with Apache & Perl (already loaded) and later MySQL to run as development/test before uploading to my ISP. Is there a quick checklist to use to get Perl scripts to run under Apache this way? Bob Benjamin [EMAIL PROTECTED] So. Pasadena, CA -- To unsubsc