Jump to content

paulie

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

paulie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thanks for the reply. The variables $start and $finish both contain the following data $time=time(); $start=date("d-M-y G:i:s", time()); I tried the code but it came back with an unknown DB error
  2. I am attempting to enter information, typed into an HTML form, into an Oracle database. I have been able to do this successfully with the following code: $dsn = "odbc://$user:$pass@$host/$database"; $db = DB::connect($dsn); if(DB::isError($db)){ die ($db->getMessage()); } $table_name = 'engineers_worksheet'; $fields_values = array( 'pk_worksheet_id' => $pk_no, 'unit_id' => $unitno, 'asset_name' => $regno, 'asset_make' => $makemod, 'customer' => $client, 'site_address' => $siteadd, 'asset_set_point_temp' => $celsius, 'asset_defrost_interval_hrs' => $defrost, 'unit_status' => $status, 'asset_condition' => $condition, 'lights_working_before' => $lightsb, 'lights_working_after' => $lightsa, 'asset_defects' => $defects, 'work_done' => $work, 'parts_used1' => $parts1, 'parts_used2' => $parts2, 'parts_used3' => $parts3, 'parts_used4' => $parts4, 'parts_used5' => $parts5, 'parts_used6' => $parts6, [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]'start_time' => $start,[!--colorc--][/span][!--/colorc--] [!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]'end_time' => $finish,[!--colorc--][/span][!--/colorc--] 'engineer' => $psswd ); $res = $db->autoExecute($table_name, $fields_values, DB_AUTOQUERY_INSERT); if (PEAR::isError($res)) { die($res->getMessage()); } I have highlighted the start_time and end_time parts of the code because, although I have been successful in entering a date into the dataebase, I would also like a time value to be entered. Does anybody know of any way to format the variable, similar to SQL formatting of date and time, so that both date and time will be entered into the database? i.e. 'start_time' => ($start, 'DD-MON-YY HH24:MI:SS)
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.