Tables with multiple indexes

QuestionsTables with multiple indexes
Massimo Gagliardi asked 5 years ago

Hi Abu
To allow the proper operation of your Database Table Editor, when you have tables with multiple indexes, I modified your script in this mode:

row 82:
// set database table for CRUD operations
$g->table = $tab;
// GAGLIARDI
$g->select_command = "WHERE Lingua = '" . $_SESSION["Lingua"] . "'";
// GAGLIARDI

and jqgrid_dist.php in these points:

1. row nr. 690
/* GAGLIARDI
if (!$this->select_command && $this->table)
$this->select_command = "SELECT * FROM ".$this->table;
GAGLIARDI */
if ($this->table && (!$this->select_command || strtolower(substr($this->select_command, 0, 5))=="where"))
$this->select_command = "SELECT * FROM ".$this->table.' '.$this->select_command;

2. row nr. 1538
/* GAGLIARDI
$sql = "UPDATE {$this->table} $update_str WHERE $pk_field IN ($id)";
GAGLIARDI */
if (strpos(strtolower($this->select_command), "where")>-1) {
$where = substr($this->select_command, strpos(strtolower($this->select_command), "where"));
$sql = "UPDATE {$this->table} $update_str $where AND $pk_field IN ($id)";
}

I hope will be helpful.

1 Answers
Abu Ghufran answered 5 years ago

Thanks for sharing.
Will review for merge in main line.

Your Answer

12 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?