Edit report at https://bugs.php.net/bug.php?id=55239&edit=1

 ID:                 55239
 Updated by:         fel...@php.net
 Reported by:        m4rk dot gm4il at gmail dot com
 Summary:            dbase date field
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            dBase related
 Operating System:   WINXP
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

Hi, report dbase bugs on http://pecl.php.net/bugs/report.php?package=dbase

Anyway, I've tested and it works fine:

<?php

date_default_timezone_set('UTC');

$def = array(
  array("date",     "D"),
  array("name",     "C",  50),
  array("age",      "N",   3, 0),
  array("email",    "C", 128),
  array("ismember", "L")
);

dbase_create ('/tmp/test.dbf', $def);
$db = dbase_open('/tmp/test.dbf', 2);

dbase_add_record($db, array(
      date('Ymd'), 
      'Maxim Topolov', 
      '23', 
      'm...@example.com',
      'T'));   

var_dump(dbase_get_record($db, 1));
dbase_close($db);


array(6) {
  [0]=>
  string(8) "20110719"
  [1]=>
  string(50) "Maxim Topolov                                     "
  [2]=>
  int(23)
  [3]=>
  string(128) "m...@example.com                                                 
                                                                "
  [4]=>
  int(1)
  ["deleted"]=>
  int(0)
}


Previous Comments:
------------------------------------------------------------------------
[2011-07-19 07:12:25] m4rk dot gm4il at gmail dot com

Description:
------------
---
>From manual page: http://www.php.net/function.dbase-add-record%23Examples
and http://www.php.net/manual/en/function.dbase-create.php
---

<?php

// database "definition"
$def = array(
  array("date",     "D"),
  array("name",     "C",  50),
  array("age",      "N",   3, 0),
  array("email",    "C", 128),
  array("ismember", "L")
);

// creation
if (!dbase_create('/tmp/test.dbf', $def)) {
  echo "Error, can't create the database\n";
}


// open in read-write mode
$db = dbase_open('/tmp/test.dbf', 2);

if ($db) {
  dbase_add_record($db, array(
      date('Ymd'), 
      'Maxim Topolov', 
      '23', 
      'm...@example.com',
      'T'));   
  dbase_close($db);
}

?>

Expected result:
----------------
the data on date, name, age, email, ismember
should all be saved on dbf.


Actual result:
--------------
upon saving the database, the date field and ismember field have 0 length.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55239&edit=1

Reply via email to