Hi noelt,


> i mean, the value of the duration field will be transferred or
> copied to the consumed field w/c is in a diff. table.

So these are just some fields like column1 and column2 - nothing
to do with duration of the process itself.

The following is in php and uses class db_mysql - there are
numerous other ways to do it, just to show you how I would do it:

$db = newDB($db);
//connect to database

$q = "SELECT * FROM table 1
        WHERE key1 = 'value1'";
//state query, try insert
$db->query($q);
//perform query
if ($db->nf()){//success
        $db->next_record();//get record
        $field1 = $db->f('field1');//extract field
}
//now look at the other table
$q = "INSERT INTO table2
        (col1, col2, col3) //and so on
        VALUES ('$field1', '$field2', '$field3')";
//state query
$db->query($q);
//perform query
if ($db->Errno){//entry already there
        $q = "UPDATE table2
                SET val1 = '$field1',
                        val2 = '$field2',
                        val3 = '$field3',
                WHERE key2 = '$field1'";//assuming that this is a key element
        //do an update instead
        $db->query($q);
}

> perl? can you elaborate more on this, i mean i know perl but can you give me more 
>ideas...

Personally, I prefer php to perl, but it is a matter of taste and
experience. There is an entertaining article entitled MySQL Wizardry
at address

             http://mysql.com/articles/wizard/

which shows how to work with databases and perl. Highly
recommended.

-- 
Herzlich
Werner Stuerenburg            

_________________________________________________
ISIS Verlag, Teut 3, D-32683 Barntrup-Alverdissen
Tel 0(049) 5224-997 407 · Fax 0(049) 5224-997 409
http://pferdezeitung.de



---------------------------------------------------------------------
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

Reply via email to