<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.dbase.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.dbase-create.php',
    1 => 'dbase_create',
    2 => 'Erzeugt eine Datenbank',
  ),
  'up' => 
  array (
    0 => 'ref.dbase.php',
    1 => 'dBase Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.dbase-close.php',
    1 => 'dbase_close',
  ),
  'next' => 
  array (
    0 => 'function.dbase-delete-record.php',
    1 => 'dbase_delete_record',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/dbase/functions/dbase-create.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.dbase-create" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">dbase_create</h1>
  <p class="verinfo">(PHP 5 &lt; 5.3.0, dbase 5, dbase 7)</p><p class="refpurpose"><span class="refname">dbase_create</span> &mdash; <span class="dc-title">Erzeugt eine Datenbank</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.dbase-create-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>dbase_create</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$fields</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$type</code><span class="initializer"> = DBASE_TYPE_DBASE</span></span>): <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span></div>

  <p class="para rdfs-comment">
   Erzeugt eine der angegebenen Definition entsprechende dBase-Datenbank.
   Existiert die Datei bereits, wird sie nicht gekürzt.
   <span class="function"><a href="function.dbase-pack.php" class="function">dbase_pack()</a></span> kann aufgerufen werden, um die Kürzung zu
   erzwingen.
  </p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: <p class="para">Diese Funktion wird von
<a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a> beeinflusst.</p></p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.dbase-create-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">path</code></dt>
     <dd>
      <p class="para">
       Der Pfad der Datenbank. Das kann ein relativer oder absoluter Pfad zu
       der Datei sein, in der dBase die Daten speichert.
      </p>
     </dd>
    
    
     <dt><code class="parameter">fields</code></dt>
     <dd>
      <p class="para">
       Ein Array aus Arrays, von denen jedes das Format eines Datenbankfeldes
       beschreibt. Jedes Feld besteht aus einem Namen, einem Zeichen für den
       Feldtyp und gegebenenfalls einer Länge, einer Genauigkeit und einem
       nullable-Flag. Die unterstützten Feldtypen sind im <a href="book.dbase.php#intro.dbase" class="link">Einführungsabschnitt</a> aufgeführt.
      </p>
      <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
       <p class="para">
        Die Feldnamen sind längenbeschränkt, und dürfen 10 Zeichen nicht
        überschreiten.
       </p>
      </p></blockquote>
     </dd>
    
    
     <dt><code class="parameter">type</code></dt>
     <dd>
      <p class="para">
       Der zu erzeugende Datenbanktype. Entweder
       <strong><code><a href="dbase.constants.php#constant.dbase-type-dbase">DBASE_TYPE_DBASE</a></code></strong> oder
       <strong><code><a href="dbase.constants.php#constant.dbase-type-foxpro">DBASE_TYPE_FOXPRO</a></code></strong>.
      </p>
     </dd>
    
    </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.dbase-create-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt eine Datenbank-Ressource zurück, falls die Datenbank erfolgreich
   erzeugt werden konnte oder <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, falls ein Fehler auftrat.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.dbase-create-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>PECL dbase 7.0.0</td>
      <td>
       Der Parameter <code class="parameter">type</code> wurde hinzugefügt.
      </td>
     </tr>

     <tr>
      <td>PECL dbase 7.0.0</td>
      <td>
       Der Rückgabewert ist nun vom Typ <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> statt
       <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.dbase-create-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Erzeugen einer dBase-Datenbankdatei</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// Datenbank-"Definition"<br /></span><span style="color: #0000BB">$def </span><span style="color: #007700">= array(<br />  array(</span><span style="color: #DD0000">"Datum"</span><span style="color: #007700">,       </span><span style="color: #DD0000">"D"</span><span style="color: #007700">),<br />  array(</span><span style="color: #DD0000">"Name"</span><span style="color: #007700">,        </span><span style="color: #DD0000">"C"</span><span style="color: #007700">,  </span><span style="color: #0000BB">50</span><span style="color: #007700">),<br />  array(</span><span style="color: #DD0000">"Alter"</span><span style="color: #007700">,       </span><span style="color: #DD0000">"N"</span><span style="color: #007700">,   </span><span style="color: #0000BB">3</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">),<br />  array(</span><span style="color: #DD0000">"Email"</span><span style="color: #007700">,       </span><span style="color: #DD0000">"C"</span><span style="color: #007700">, </span><span style="color: #0000BB">128</span><span style="color: #007700">),<br />  array(</span><span style="color: #DD0000">"IstMitglied"</span><span style="color: #007700">, </span><span style="color: #DD0000">"L"</span><span style="color: #007700">)<br />);<br /><br /></span><span style="color: #FF8000">// Erzeugung<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">dbase_create</span><span style="color: #007700">(</span><span style="color: #DD0000">'/tmp/test.dbf'</span><span style="color: #007700">, </span><span style="color: #0000BB">$def</span><span style="color: #007700">)) {<br />  echo </span><span style="color: #DD0000">"Fehler, konnte die Datenbank nicht erzeugen\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.dbase-create-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.dbase-open.php" class="function" rel="rdfs-seeAlso">dbase_open()</a> - &Ouml;ffnet eine Datenbank</span></li>
    <li><span class="function"><a href="function.dbase-close.php" class="function" rel="rdfs-seeAlso">dbase_close()</a> - Schlie&szlig;t eine Datenbank</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>