Hi Manish,
When you are dealing with configuration storage, you need to use controluser link for database interface. Otherwise, it will use current user to execute queries. Current user may not have permissions to even access phpmyadmin database. You can do this by passing $GLOBALS['controluser'] as parameter to any function operating with DBI. I am assuming that you have set up controluser and similar parameters in config.inc.php file. If it still doesn't work, please share the error you are getting.
Regards, Raghuram
On 17-Jul-2017 3:16 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
How to use the phpmyadmin configuration database properly.
I am using the following code.
$GLOBALS['dbi']->selectDb('phpmyadmin'); $GLOBALS['dbi']->tryQuery('INSERT INTO `pma__progress` VALUES ("sas", "sas", 50, 100)');
Let me know if I am correct or wrong. I think I am missing something.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:07 PM, Manish Bisht manish.bisht490@gmail.com wrote:
Thanks
Just created the table by running import.
How to save data in the tables by running queries from any file.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:02 PM, Raghuram Vadapalli < raghuram.vadapalli@research.iiit.ac.in> wrote:
Hi,
You have to run that sql file. Running it is part of installation process as far as I know.
Regards, Raghuram
On 15-Jul-2017 4:38 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
Hi,
To store the import/export progress I have added one new table in sql/create_tables.sql file but I can't see my new table in the phpmyadmin database. How to update phpmyadmin database from that file. I guess there is something that do it automatically instead of manually executing the statement.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
_______________________________________________ Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
I have not passed any parameter to function operating with DBI. But the following statements run successfully.
$GLOBALS['dbi']->selectDb('phpmyadmin'); $GLOBALS['dbi']->tryQuery('INSERT INTO `pma__progress` VALUES ("sas", "sas", 50, 100)');
This might be due to I am logged in as root.
When we add any table column to central columns from table structure page it was added configuration storage in table pma__central_column.
I want to do the similar kind of operation and insert data in configuration storage in pma__progress table. The above statements are running without any errors. But the issue is I think there is a better way to implement the above statements because in the entire project directory I have not found that the configuration storage database name and table are hard coded in the statements like I am doing.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 4:57 PM, Raghuram Vadapalli < raghuram.vadapalli@research.iiit.ac.in> wrote:
Hi Manish,
When you are dealing with configuration storage, you need to use controluser link for database interface. Otherwise, it will use current user to execute queries. Current user may not have permissions to even access phpmyadmin database. You can do this by passing $GLOBALS['controluser'] as parameter to any function operating with DBI. I am assuming that you have set up controluser and similar parameters in config.inc.php file. If it still doesn't work, please share the error you are getting.
Regards, Raghuram
On 17-Jul-2017 3:16 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
How to use the phpmyadmin configuration database properly.
I am using the following code.
$GLOBALS['dbi']->selectDb('phpmyadmin'); $GLOBALS['dbi']->tryQuery('INSERT INTO `pma__progress` VALUES ("sas", "sas", 50, 100)');
Let me know if I am correct or wrong. I think I am missing something.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:07 PM, Manish Bisht manish.bisht490@gmail.com wrote:
Thanks
Just created the table by running import.
How to save data in the tables by running queries from any file.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:02 PM, Raghuram Vadapalli < raghuram.vadapalli@research.iiit.ac.in> wrote:
Hi,
You have to run that sql file. Running it is part of installation process as far as I know.
Regards, Raghuram
On 15-Jul-2017 4:38 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
Hi,
To store the import/export progress I have added one new table in sql/create_tables.sql file but I can't see my new table in the phpmyadmin database. How to update phpmyadmin database from that file. I guess there is something that do it automatically instead of manually executing the statement.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
I found three ways to execute the query. What is the difference between these.
$GLOBALS['dbi']->query($sql_query);
$GLOBALS['dbi']->tryQuery($sql_query);
PMA_queryAsControlUser($sql_query);
What is the difference between these. What I know is query() returns error and tryQuery() doesn't returns error.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 6:33 PM, Manish Bisht manish.bisht490@gmail.com wrote:
I have not passed any parameter to function operating with DBI. But the following statements run successfully.
$GLOBALS['dbi']->selectDb('phpmyadmin'); $GLOBALS['dbi']->tryQuery('INSERT INTO `pma__progress` VALUES ("sas", "sas", 50, 100)');
This might be due to I am logged in as root.
When we add any table column to central columns from table structure page it was added configuration storage in table pma__central_column.
I want to do the similar kind of operation and insert data in configuration storage in pma__progress table. The above statements are running without any errors. But the issue is I think there is a better way to implement the above statements because in the entire project directory I have not found that the configuration storage database name and table are hard coded in the statements like I am doing.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 4:57 PM, Raghuram Vadapalli < raghuram.vadapalli@research.iiit.ac.in> wrote:
Hi Manish,
When you are dealing with configuration storage, you need to use controluser link for database interface. Otherwise, it will use current user to execute queries. Current user may not have permissions to even access phpmyadmin database. You can do this by passing $GLOBALS['controluser'] as parameter to any function operating with DBI. I am assuming that you have set up controluser and similar parameters in config.inc.php file. If it still doesn't work, please share the error you are getting.
Regards, Raghuram
On 17-Jul-2017 3:16 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
How to use the phpmyadmin configuration database properly.
I am using the following code.
$GLOBALS['dbi']->selectDb('phpmyadmin'); $GLOBALS['dbi']->tryQuery('INSERT INTO `pma__progress` VALUES ("sas", "sas", 50, 100)');
Let me know if I am correct or wrong. I think I am missing something.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:07 PM, Manish Bisht manish.bisht490@gmail.com wrote:
Thanks
Just created the table by running import.
How to save data in the tables by running queries from any file.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:02 PM, Raghuram Vadapalli < raghuram.vadapalli@research.iiit.ac.in> wrote:
Hi,
You have to run that sql file. Running it is part of installation process as far as I know.
Regards, Raghuram
On 15-Jul-2017 4:38 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
Hi,
To store the import/export progress I have added one new table in sql/create_tables.sql file but I can't see my new table in the phpmyadmin database. How to update phpmyadmin database from that file. I guess there is something that do it automatically instead of manually executing the statement.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
I have created a new progress.php file in root directory and when I open this file in browser it doesn't show me the data.
use PhpMyAdmin\DatabaseInterface; $GLOBALS['dbi']->selectDb($cfgRelation['db']); $sql_query = 'SELECT * FROM ' . $cfgRelation['progress'] . ' WHERE type = "export"'; $result = $GLOBALS['dbi']->query($sql_query); $result = $GLOBALS['dbi']->fetchRow($result); echo json_encode($result);
and when I add one extra line(mentioned below) it show me the data but with navigation and tabs which I don't need.
include_once 'libraries/common.inc.php';
I think this might be due to the some security reason. Any way I can show data on this page in JSON format.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 9:52 PM, Manish Bisht manish.bisht490@gmail.com wrote:
I found three ways to execute the query. What is the difference between these.
$GLOBALS['dbi']->query($sql_query);
$GLOBALS['dbi']->tryQuery($sql_query);
PMA_queryAsControlUser($sql_query);
What is the difference between these. What I know is query() returns error and tryQuery() doesn't returns error.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 6:33 PM, Manish Bisht manish.bisht490@gmail.com wrote:
I have not passed any parameter to function operating with DBI. But the following statements run successfully.
$GLOBALS['dbi']->selectDb('phpmyadmin'); $GLOBALS['dbi']->tryQuery('INSERT INTO `pma__progress` VALUES ("sas", "sas", 50, 100)');
This might be due to I am logged in as root.
When we add any table column to central columns from table structure page it was added configuration storage in table pma__central_column.
I want to do the similar kind of operation and insert data in configuration storage in pma__progress table. The above statements are running without any errors. But the issue is I think there is a better way to implement the above statements because in the entire project directory I have not found that the configuration storage database name and table are hard coded in the statements like I am doing.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 4:57 PM, Raghuram Vadapalli < raghuram.vadapalli@research.iiit.ac.in> wrote:
Hi Manish,
When you are dealing with configuration storage, you need to use controluser link for database interface. Otherwise, it will use current user to execute queries. Current user may not have permissions to even access phpmyadmin database. You can do this by passing $GLOBALS['controluser'] as parameter to any function operating with DBI. I am assuming that you have set up controluser and similar parameters in config.inc.php file. If it still doesn't work, please share the error you are getting.
Regards, Raghuram
On 17-Jul-2017 3:16 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
How to use the phpmyadmin configuration database properly.
I am using the following code.
$GLOBALS['dbi']->selectDb('phpmyadmin'); $GLOBALS['dbi']->tryQuery('INSERT INTO `pma__progress` VALUES ("sas", "sas", 50, 100)');
Let me know if I am correct or wrong. I think I am missing something.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:07 PM, Manish Bisht <manish.bisht490@gmail.com
wrote:
Thanks
Just created the table by running import.
How to save data in the tables by running queries from any file.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Sat, Jul 15, 2017 at 5:02 PM, Raghuram Vadapalli < raghuram.vadapalli@research.iiit.ac.in> wrote:
Hi,
You have to run that sql file. Running it is part of installation process as far as I know.
Regards, Raghuram
On 15-Jul-2017 4:38 PM, "Manish Bisht" manish.bisht490@gmail.com wrote:
Hi,
To store the import/export progress I have added one new table in sql/create_tables.sql file but I can't see my new table in the phpmyadmin database. How to update phpmyadmin database from that file. I guess there is something that do it automatically instead of manually executing the statement.
Thanks,
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Hi
Manish Bisht píše v Po 17. 07. 2017 v 23:02 +0530:
I have created a new progress.php file in root directory and when I open this file in browser it doesn't show me the data.
use PhpMyAdmin\DatabaseInterface; $GLOBALS['dbi']->selectDb($cfgRelation['db']); $sql_query = 'SELECT * FROM ' . $cfgRelation['progress'] . ' WHERE type = "export"'; $result = $GLOBALS['dbi']->query($sql_query); $result = $GLOBALS['dbi']->fetchRow($result); echo json_encode($result); and when I add one extra line(mentioned below) it show me the data but with navigation and tabs which I don't need. include_once 'libraries/common.inc.php'; I think this might be due to the some security reason. Any way I can show data on this page in JSON format.
You need to pass ajax_request in the request in case you want it to output JSON only.
Hi
Manish Bisht píše v Po 17. 07. 2017 v 21:52 +0530:
I found three ways to execute the query. What is the difference between these. $GLOBALS['dbi']->query($sql_query); $GLOBALS['dbi']->tryQuery($sql_query); PMA_queryAsControlUser($sql_query);
What is the difference between these. What I know is query() returns error and tryQuery() doesn't returns error.
And PMA_queryAsControlUser is just wrapper around these two:
https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/relation .lib.php#L27
I am not able to get where to pass ajax_request in the GET or POST parameter or it is different.
I am doing something like this to get the JSON response.
$.ajax({ url: "progress.php" }).done(function() { //success });
How to pass ajax_request in this request.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 11:14 PM, Michal Čihař michal@cihar.com wrote:
Hi
Manish Bisht píše v Po 17. 07. 2017 v 21:52 +0530:
I found three ways to execute the query. What is the difference between these. $GLOBALS['dbi']->query($sql_query); $GLOBALS['dbi']->tryQuery($sql_query); PMA_queryAsControlUser($sql_query);
What is the difference between these. What I know is query() returns error and tryQuery() doesn't returns error.
And PMA_queryAsControlUser is just wrapper around these two:
https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/relation .lib.php#L27
-- Michal Čihař | https://cihar.com/ | https://weblate.org/
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Hi
Manish Bisht píše v Po 17. 07. 2017 v 23:17 +0530:
I am not able to get where to pass ajax_request in the GET or POST parameter or it is different.
I am doing something like this to get the JSON response.
$.ajax({ url: "progress.php" }).done(function() { //success });
How to pass ajax_request in this request.
Following should do that:
$.ajax({ url: "progress.php", data: {ajax_request: '1'} }).done(function() { //success });
Thanks this works for me. :)
I have checked other ajax requests and found that some extra parameter
server : PMA_commonParams.get('server'), db : PMA_commonParams.get('db'), table : PMA_commonParams.get('table'),
are passed in the ajax request. What is the need of this so that I can check if these are required in my case.
I think these are used to get the currently selected tables, database so that the operations can be performed on them. Then this is not required in my case and I can simply ignore these.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Mon, Jul 17, 2017 at 11:32 PM, Michal Čihař michal@cihar.com wrote:
Hi
Manish Bisht píše v Po 17. 07. 2017 v 23:17 +0530:
I am not able to get where to pass ajax_request in the GET or POST parameter or it is different.
I am doing something like this to get the JSON response.
$.ajax({ url: "progress.php" }).done(function() { //success });
How to pass ajax_request in this request.
Following should do that:
$.ajax({ url: "progress.php", data: {ajax_request: '1'} }).done(function() { //success });
-- Michal Čihař | https://cihar.com/ | https://weblate.org/
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Hello,
On 7/17/17 12:22 PM, Manish Bisht wrote:
I found three ways to execute the query. What is the difference between these.
$GLOBALS['dbi']->query($sql_query);
$GLOBALS['dbi']->tryQuery($sql_query);
PMA_queryAsControlUser($sql_query);
What is the difference between these. What I know is query() returns error and tryQuery() doesn't returns error.
Michal has already answered most of this, but query() calls tryQuery() and if it fails, it die()s. queryAsControlUser() specifically runs as the controluser[1][2] so that's what we'd want here.
You can see this in DatabaseInterface.php[3]
1 - https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-st... 2 - https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controluser 3 - https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/classes/Datab...
On 7/17/17 2:20 PM, Manish Bisht wrote:
I have checked other ajax requests and found that some extra parameter
server : PMA_commonParams.get('server'), db : PMA_commonParams.get('db'), table : PMA_commonParams.get('table'),
are passed in the ajax request. What is the need of this so that I can check if these are required in my case.
I'm pretty confident that these are used to tell phpMyAdmin which server, database, and table are currently active. For instance, after copying a table to a new database, the user may wish to switch to the newly copied one instead of staying on the same page; these functions facilitate that change.
Then this is not required in my case and I can simply ignore these.
Sure, that sounds correct.
I think all of your other questions have been answered by the others, so let me know of course if there's anything I missed.
Isaac
To make the export progress more efficient. Is there any php page to which I can do the ajax request and run the query on phpmyadmin configuration database.
Manish Bisht Email : hi@manishbisht.me Website : https://manishbisht.me
On Tue, Jul 18, 2017 at 3:57 AM, Isaac Bennetch bennetch@gmail.com wrote:
Hello,
On 7/17/17 12:22 PM, Manish Bisht wrote:
I found three ways to execute the query. What is the difference between these.
$GLOBALS['dbi']->query($sql_query);
$GLOBALS['dbi']->tryQuery($sql_query);
PMA_queryAsControlUser($sql_query);
What is the difference between these. What I know is query() returns error and tryQuery() doesn't returns error.
Michal has already answered most of this, but query() calls tryQuery() and if it fails, it die()s. queryAsControlUser() specifically runs as the controluser[1][2] so that's what we'd want here.
You can see this in DatabaseInterface.php[3]
1 - https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration- storage 2 - https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controluser 3 - https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/classes/ DatabaseInterface.php#L140-146
On 7/17/17 2:20 PM, Manish Bisht wrote:
I have checked other ajax requests and found that some extra parameter
server : PMA_commonParams.get('server'), db : PMA_commonParams.get('db'), table : PMA_commonParams.get('table'),
are passed in the ajax request. What is the need of this so that I can check if these are required in my case.
I'm pretty confident that these are used to tell phpMyAdmin which server, database, and table are currently active. For instance, after copying a table to a new database, the user may wish to switch to the newly copied one instead of staying on the same page; these functions facilitate that change.
Then this is not required in my case and I can simply ignore these.
Sure, that sounds correct.
I think all of your other questions have been answered by the others, so let me know of course if there's anything I missed.
Isaac
Developers mailing list Developers@phpmyadmin.net https://lists.phpmyadmin.net/mailman/listinfo/developers
Hello
Manish Bisht píše v Út 18. 07. 2017 v 21:25 +0530:
To make the export progress more efficient. Is there any php page to which I can do the ajax request and run the query on phpmyadmin configuration database.
There is ajax.php which can probably be used for this.