in php-scripts, to insert data to database, i'm doing like this:

  ...
  $query_param = array(
    'field0' => 1,
    'field1' => 3,
    'field2' => $var2,
    'field3' => $var3,
  );
  ...

  $sql = "INSERT INTO $table (".implode(", ", array_keys($query_param)).") VALUES 
('".implode("','", $query_param)."')";

  how it can be done, using python (elegantly, without cycles)?


-- Best regards, Maksim Kasimov mailto: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Reply via email to