mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
doc update for 4D v12.0
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@296385 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
17918575fd
commit
aaebccf8bb
4 changed files with 41 additions and 41 deletions
|
@ -89,6 +89,7 @@
|
|||
<programlisting>
|
||||
<![CDATA[
|
||||
4D:host=localhost
|
||||
4D:
|
||||
]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
|
|
|
@ -21,7 +21,7 @@ $user = 'test';
|
|||
$pass = 'test';
|
||||
|
||||
// Connection to the 4D SQL server
|
||||
$db = new PDO_4D($dsn, $user, $pass);
|
||||
$db = new PDO($dsn, $user, $pass);
|
||||
|
||||
try {
|
||||
$db->exec('CREATE TABLE test(id varCHAR(1) NOT NULL, val VARCHAR(10))');
|
||||
|
@ -109,7 +109,7 @@ $user = 'test';
|
|||
$pass = 'test';
|
||||
|
||||
// Connection to the 4D server
|
||||
$db = new pdo($dsn, $user, $pass);
|
||||
$db = new PDO($dsn, $user, $pass);
|
||||
|
||||
$stmt = $db->prepare('SELECT {FN method() AS VARCHAR } FROM _USER_SCHEMAS LIMIT 1');
|
||||
|
||||
|
@ -153,7 +153,7 @@ $user = 'test';
|
|||
$pass = 'test';
|
||||
|
||||
// Connection to 4D server 4D
|
||||
$db = new PDO_4D($dsn, $user, $pass);
|
||||
$db = new PDO($dsn, $user, $pass);
|
||||
|
||||
$objects = array('[',']','[]','][','[[',']]','[[[',']]]','TBL ]]32[23');
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<!-- Membership: bundled, external, pecl -->
|
||||
|
||||
<reference xml:id="ref.pdo-4d" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>Driver 4D for PDO (PDO_4D)</title>
|
||||
<titleabbrev>Driver 4D for PDO</titleabbrev>
|
||||
<title>4D Functions (PDO_4D)</title>
|
||||
<titleabbrev>4D (PDO)</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
<section xml:id="pdo-4d.intro">
|
||||
|
@ -46,10 +46,8 @@
|
|||
More details about the 4D development environment on <link xlink:href="&url.4d;">&url.4d;</link>.
|
||||
</para>
|
||||
<para>
|
||||
PDO_4D has been developed to work on Windows (Vista),
|
||||
Mac OS X (10.5) and Linux (Debian-tested). It is known to work with
|
||||
4D versions 11.4 and up, for Mac OS X and Windows. Older
|
||||
plat-forms may work, but are unsupported.
|
||||
PDO_4D is known to work with 4D versions 12 beta and up, for Mac OS X
|
||||
and Windows. Older plat-forms may work, but are unsupported.
|
||||
</para>
|
||||
</section>
|
||||
</partintro>
|
||||
|
|
|
@ -31,55 +31,57 @@
|
|||
<tbody>
|
||||
<row>
|
||||
<entry>INTEGER</entry>
|
||||
<entry>INT is the supported integer type. Modify the SQL to use INT.</entry>
|
||||
<entry></entry>
|
||||
<entry>Modify the SQL to use INT.</entry>
|
||||
<entry>INT is the supported integer type in 4Dv12.0.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>CHAR</entry>
|
||||
<entry>Use VARCHAR instead.</entry>
|
||||
<entry>Unsupported in 4Dv12.0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>UNION</entry>
|
||||
<entry>Unsupported. Make separate queries.</entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>LEFT JOIN</entry>
|
||||
<entry>Use the SQL 89 notation</entry>
|
||||
<entry></entry>
|
||||
<entry>Unsupported in 4Dv12.0</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SELECT 1 + 1;</entry>
|
||||
<entry>SELECT 1 + 1 FROM _USER_SCHEMAS;</entry>
|
||||
<entry></entry>
|
||||
<entry>FROM is required</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>FLOAT</entry>
|
||||
<entry>Cast the FLOAT value with a SQL 4D function (ROUND, TRUNC or TRUNCATE)</entry>
|
||||
<entry>Unsupported in the driver PDO_4D v1.0</entry>
|
||||
<entry>Cast the FLOAT value into a FLOAT or STRING, with a SQL 4D function (CAST, ROUND, TRUNC or TRUNCATE)</entry>
|
||||
<entry>Unsupported in current versions of the PDO_4D driver</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>Strong typing : one must provide the right type that 4D expect. One can't insert '1' (as a string) in an INTEGER column.</entry>
|
||||
<entry>Modify your SQL query, or your PHP to adapt the type</entry>
|
||||
<entry>Unsupported</entry>
|
||||
<entry>Strong typing</entry>
|
||||
<entry>Take care your SQL query, or your PHP code provides data with the expected type</entry>
|
||||
<entry>
|
||||
One must provide the right type that 4D expect. One can't insert '1' (as a string) in an INTEGER column.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><function>PDO::execute($row)</function></entry>
|
||||
<entry>Use the prepared statements, and use the right types. It will also
|
||||
only works if all the table's column are of type <literal>TEXT</literal>.</entry>
|
||||
<entry><function>PDO::execute($row)</function> : only works if all the table's column are of type TEXT or VARCHAR</entry>
|
||||
<entry>Use the prepared statements, and use the right types.</entry>
|
||||
<entry>The PDO extension cast all values through execute() as string, and expect the SQL database to parse the values.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SELECT NULL FROM TABLE</entry>
|
||||
<entry>It is not allowed to use the NULL constante in the select list</entry>
|
||||
<entry>Do not use NULL constants. Extract them from the table</entry>
|
||||
<entry>It is not allowed to use the NULL constant in the select list</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SELECT * FROM TABLE WHERE 1</entry>
|
||||
<entry>A constant can't be used in a WHERE clause.</entry>
|
||||
<entry>Use <literal>1 = 1</literal></entry>
|
||||
<entry>Use WHERE 1 = 1</entry>
|
||||
<entry>A constant can't be used in a WHERE clause</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SHOW TABLES</entry>
|
||||
<entry>The list of tables, schemas, index, etc. are in 7 4D tables</entry>
|
||||
<entry>Use system tables</entry>
|
||||
<entry>
|
||||
Use <literal>_USER_TABLES</literal>, <literal>_USER_COLUMNS</literal>,
|
||||
The list of tables, schemas, index, etc. are in these system tables :
|
||||
<literal>_USER_TABLES</literal>, <literal>_USER_COLUMNS</literal>,
|
||||
<literal>_USER_INDEXES</literal>, <literal>_USER_CONSTRAINTS</literal>,
|
||||
<literal>_USER_IND_COLUMNS</literal>, <literal>_USER_CONS_COLUMNS</literal>,
|
||||
and <literal>_USER_SCHEMAS</literal>.
|
||||
|
@ -87,14 +89,17 @@
|
|||
</row>
|
||||
<row>
|
||||
<entry>SQL structure delimiter</entry>
|
||||
<entry>To escape SQL elements (tables, fields, users, groups, schema,
|
||||
primary key, etc.), closing brackets must be doubled, and the whole
|
||||
identifier must be between square brackets.
|
||||
<entry>
|
||||
Use the following function to protect SQL elements:
|
||||
function sqlEscapeElement(elem) {
|
||||
return '[' . str_replace(']',']]', $elem) . ']';
|
||||
}
|
||||
</entry>
|
||||
<entry>
|
||||
Use the following function to protect SQL objects, and then,
|
||||
put it between square brackets :
|
||||
<literal>str_replace(']',']]', $table)</literal>.
|
||||
To escape SQL elements names (tables, fields, users,
|
||||
groups, schema, primary key, etc.), the whole identifier
|
||||
must be between square brackets, and the closing
|
||||
brackets ']' must be doubled.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
@ -103,10 +108,6 @@
|
|||
</para>
|
||||
<note>
|
||||
<para>
|
||||
In version 11.3 and below, it wasn't possible to use the SQL syntax
|
||||
<literal>id INT PRIMARY KEY</literal> during the creation of a table.
|
||||
This have been fixed in 4D 11.4 and up. It is recommended to use
|
||||
at least version 11.4 with PDO_4D.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
|
Loading…
Reference in a new issue