note 118886 added to function.px-create-fp
| From: | NatanaelSimes | Date: | Mon, 22 Feb 2016 19:21:26 +0000 |
| Subject: | note 118886 added to function.px-create-fp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-205013@lists.php.net to get a copy of this message | ||
(Using php 5.5)
Values of constant field type appears to be inconsistent. Dumping values will show you integer
values, including information retrived by px_get_field for type. Field specification in px_create_fp
demands to be a char value, because number will be resolved as unknown types. Here is a list with
value for each field type that actually works:
ALPHANUMERIC = A
DATE = D
SHORT INTEGER = D
LONG INTEGER = I
CURRENCY = $
NUMBER = N
DOUBLE = N
LOGICAL = L
BOOLEAN = L
MEMOBLOB = M
BLOG = B
FMTMEMOBLOB = F
OLE = O
GRAPHIC = G
TIME = T
TIMESTAMP = @
AUTOINC = +
BCD = #
BYTES = Y
<?php
$fields = array();
$id = array('id', '+'); // Field name = id, type = autoinc
$name = array('name', 'A', 80); // Field name = name, type = alpha, length = 80
array_push($fields, $id);
array_push($fields, $name);
if(!$pxdoc = px_new()) {
/* Error handling */
}
$fp = fopen("test.db", "w+");
if(!px_create_fp($pxdoc, $fp, $fields)) {
/* Error handling */
}
px_close($pxdoc);
px_delete($pxdoc);
fclose($fp);
?>
And that should do the job!
----
Server IP: 72.52.91.14
Probable Submitter: 179.178.36.128
----
Manual Page -- http://php.net/manual/en/function.px-create-fp.php
Edit -- https://master.php.net/note/edit/118886
Del: integrated -- https://master.php.net/note/delete/118886/integrated
Del: useless -- https://master.php.net/note/delete/118886/useless
Del: bad code -- https://master.php.net/note/delete/118886/bad+code
Del: spam -- https://master.php.net/note/delete/118886/spam
Del: non-english -- https://master.php.net/note/delete/118886/non-english
Del: in docs -- https://master.php.net/note/delete/118886/in+docs
Del: other reasons-- https://master.php.net/note/delete/118886
Reject -- https://master.php.net/note/reject/118886
Search -- https://master.php.net/manage/user-notes.php