Tested the three new method mysql needed an adjustment.
This commit is contained in:
parent
16c6a7fb91
commit
a68501772f
|
|
@ -216,9 +216,17 @@ include "root.php";
|
||||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
$prep_statement = $this->db->prepare(check_sql($sql));
|
||||||
$prep_statement->execute();
|
$prep_statement->execute();
|
||||||
$tmp = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
$tmp = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||||
|
if ($this->type == "pgsql" || $this->type == "sqlite") {
|
||||||
foreach ($tmp as &$row) {
|
foreach ($tmp as &$row) {
|
||||||
$result['name'][] = $row['name'];
|
$result['name'][] = $row['name'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if ($this->type == "mysql") {
|
||||||
|
foreach ($tmp as &$row) {
|
||||||
|
$table_array = array_values($row);
|
||||||
|
$result['name'][] = $table_array[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,6 +275,7 @@ include "root.php";
|
||||||
|
|
||||||
//get the table info
|
//get the table info
|
||||||
$table_info = $this->table_info();
|
$table_info = $this->table_info();
|
||||||
|
|
||||||
//set the list of fields
|
//set the list of fields
|
||||||
if ($this->type == "sqlite") {
|
if ($this->type == "sqlite") {
|
||||||
foreach($table_info as $row) {
|
foreach($table_info as $row) {
|
||||||
|
|
@ -280,9 +289,10 @@ include "root.php";
|
||||||
}
|
}
|
||||||
if ($this->type == "mysql") {
|
if ($this->type == "mysql") {
|
||||||
foreach($table_info as $row) {
|
foreach($table_info as $row) {
|
||||||
$result['name'][] = $row['name'];
|
$result['name'][] = $row['Field'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//return the result array
|
//return the result array
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue