Revision: 734
http://tutos.svn.sourceforge.net/tutos/?rev=734&view=rev
Author: gokohnert
Date: 2012-07-27 11:27:49 +0000 (Fri, 27 Jul 2012)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/php/db/db_mysqli.pinc
Modified: trunk/php/db/db_mysqli.pinc
===================================================================
--- trunk/php/db/db_mysqli.pinc 2012-07-27 11:20:12 UTC (rev 733)
+++ trunk/php/db/db_mysqli.pinc 2012-07-27 11:27:49 UTC (rev 734)
@@ -523,7 +523,7 @@
$c = preg_replace("/U/","unique",$c);
$c = preg_replace("/NN/","",$c);
$q .= $this->colname($colname) ." ". $this->colname($colname) ." ". $t ." ". $c;
-# echo $q."<br />";
+ # echo $q."<br />";
return $this->exec($q,0);
}
@@ -539,7 +539,7 @@
* tbl = array with table description
*/
function dropindex(array $idx) {
- $q = "ALTER TABLE ". $this->prefix . $idx[table] ." DROP INDEX ". $this->prefix . $idx[name];
+ $q = 'ALTER TABLE '. $this->prefix.$idx[table] .' DROP INDEX '. $this->prefix.$idx[name];
return $this->exec($q,0);
}
@@ -550,15 +550,14 @@
if ( ! isset($idx[type]) ) {
$idx[type] = " INDEX ";
}
- $q = "ALTER TABLE ". $this->prefix . $idx[table] . " ADD ".$idx[type] ." ". $this->prefix . $idx[name] ." ";
+ $q = 'ALTER TABLE '. $this->prefix.$idx[table].' ADD '.$idx[type] .' '. $this->prefix.$idx[name];
- $pre = "(";
- @reset($idx[column]);
- while ( list ($i,$f) = @each ($idx[column]) ) {
+ $pre = ' (';
+ foreach ($idx[column] as $i => $f) {
$q .= $pre . $this->colname($f);
- $pre = ",";
+ $pre = ',';
}
- $q .= ")";
+ $q .= ')';
return $this->exec($q,0);
}
@@ -657,10 +656,12 @@
}
foreach ($table as $i => $f) {
- $q = "analyze table ". $this->prefix . $f[name];
- $this->Exec($q,0);
- $q = "optimize table ". $this->prefix. $f[name];
- $this->Exec($q,0);
+ if (isset($f[name])) {
+ $q = "analyze table ". $this->prefix . $f[name];
+ $this->Exec($q,0);
+ $q = "optimize table ". $this->prefix. $f[name];
+ $this->Exec($q,0);
+ }
}
$this->db->setLastAnalyze($now);
$msg = $this->db->save();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|