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.