Tables with multiple indexes

QuestionsTables with multiple indexes
Massimo Gagliardi asked 4 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;
$g->select_command = "WHERE Lingua = '" . $_SESSION["Lingua"] . "'";

and jqgrid_dist.php in these points:

1. row nr. 690
if (!$this->select_command && $this->table)
$this->select_command = "SELECT * FROM ".$this->table;
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
$sql = "UPDATE {$this->table} $update_str WHERE $pk_field IN ($id)";
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 4 years ago

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

Your Answer

16 + 7 =

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 / 5. Vote count:

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

Let us improve this post!