List:General Discussion« Previous MessageNext Message »
From:Micheal Mc Evoy Date:August 27 1999 10:30pm
Subject:Re: A little code help.
View as plain text  
On Fri, 27 Aug 1999, Z Mehta wrote:

>Could someone help me with a some code.  I am working with only one
>table in my database and I have a datestamp column called due_date.
>What I would like  to do is select a row with the first instance of
>'raw' in column "Status".  I then would like to change the
>"Status"column to 'idle'.
>
>$query = "SELECT * FROM queue
>   where status='raw' ORDER BY due_date ASC LIMIT 1";
>$result = mysql_query($query);
>$result = "UPDATE queue SET Status='idle'
>   where status='raw'";
>
>  Thanks Zubin

use DBI;
use strict;

my $dbh = DBI->connect($database, $user, $pword, {RaiseError => 1});
my $sth = $dbh->do("UPDATE queue SET status = 'idle' WHERE status = 'raw'");           
             
$dbh->disconnect;



---
Micheal Mc Evoy                                    mjmc@stripped
                                             http://www.whitepine.com

WhitePine Consulting supports the Free Software Foundation and it ideals
by promoting, using and supporting Open Source, GNU and GPL'd Software.

Thread
A little code help.Z Mehta27 Aug
  • Re: A little code help.Micheal Mc Evoy28 Aug
  • Re: A little code help.Paul DuBois28 Aug
  • Re: A little code help.Z Mehta28 Aug
    • Re: A little code help.Paul DuBois28 Aug
    • Re: A little code help.Paul DuBois28 Aug
  • Re: A little code help.Z Mehta28 Aug