Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
fdl_pkey.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: fdl_pkey.php,v 1.1 2003/11/03 09:12:49 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage
15  */
16 /**
17  */
18 // refreah for a classname
19 // use this only if you have changed title attributes
20 include_once ("FDL/Class.DocFam.php");
21 
23 $appl->Set("FDL", $core);
24 
25 $dbaccess = $appl->GetParam("FREEDOM_DB");
26 if ($dbaccess == "") {
27  print "Database not found : param FREEDOM_DB";
28  exit;
29 }
30 
31 $docid = GetHttpVars("docid", 0); // special docid
32 
33 $query = new QueryDb($dbaccess, "DocFam");
34 $query->AddQuery("doctype='C'");
35 
36 if ($docid > 0) $query->AddQuery("id=$docid");
37 
38 $table1 = $query->Query(0, 0, "TABLE");
39 
40 if ($query->nb > 0) {
41 
42  while (list($k, $v) = each($table1)) {
43 
44  print "alter TABLE doc" . $v["id"] . " ADD primary key (id);\n";
45  }
46 }
47 ?>
← centre documentaire © anakeen - published under CC License - Dynacase