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
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
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
> "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
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
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
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:
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
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.
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?
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
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
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
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.
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-
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
--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 "
> -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:
>
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
>
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
--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
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
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
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
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
> "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
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
> "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
> 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
> 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
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
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
"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
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
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]
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
> 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
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
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
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
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
---
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
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
--- 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
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
>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,
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
, 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
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
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>
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
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,
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
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
68 matches
Mail list logo