<div dir="ltr">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.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Manish Bisht</div><div dir="ltr">Email : <a href="mailto:hi@manishbisht.me" target="_blank">hi@manishbisht.me</a></div><div dir="ltr"><span style="font-size:12.8px">Website</span><span style="font-size:12.8px"> : </span><a href="https://manishbisht.me/" style="font-size:12.8px" target="_blank">https://manishbisht.me</a></div><div><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, Jul 18, 2017 at 3:57 AM, Isaac Bennetch <span dir="ltr"><<a href="mailto:bennetch@gmail.com" target="_blank">bennetch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<span class=""><br>
On 7/17/17 12:22 PM, Manish Bisht wrote:<br>
> I found three ways to execute the query. What is the difference between<br>
> these.<br>
><br>
> $GLOBALS['dbi']->query($sql_<wbr>query);<br>
><br>
> $GLOBALS['dbi']->tryQuery($<wbr>sql_query);<br>
><br>
> PMA_queryAsControlUser($sql_<wbr>query);<br>
><br>
><br>
> What is the difference between these. What I know is query() returns<br>
> error and tryQuery() doesn't returns error.<br>
<br>
</span>Michal has already answered most of this, but query() calls tryQuery()<br>
and if it fails, it die()s. queryAsControlUser() specifically runs as<br>
the controluser[1][2] so that's what we'd want here.<br>
<br>
You can see this in DatabaseInterface.php[3]<br>
<br>
1 -<br>
<a href="https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage" rel="noreferrer" target="_blank">https://docs.phpmyadmin.net/<wbr>en/latest/setup.html#<wbr>phpmyadmin-configuration-<wbr>storage</a><br>
2 -<br>
<a href="https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controluser" rel="noreferrer" target="_blank">https://docs.phpmyadmin.net/<wbr>en/latest/config.html#cfg_<wbr>Servers_controluser</a><br>
3 -<br>
<a href="https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/classes/DatabaseInterface.php#L140-146" rel="noreferrer" target="_blank">https://github.com/phpmyadmin/<wbr>phpmyadmin/blob/master/<wbr>libraries/classes/<wbr>DatabaseInterface.php#L140-146</a><br>
<span class=""><br>
On 7/17/17 2:20 PM, Manish Bisht wrote:<br>
> I have checked other ajax requests and found that some extra parameter<br>
><br>
> server : PMA_commonParams.get('server')<wbr>,<br>
> db : PMA_commonParams.get('db'),<br>
> table : PMA_commonParams.get('table'),<br>
><br>
> are passed in the ajax request. What is the need of this so that I can<br>
> check if these are required in my case.<br>
<br>
</span>I'm pretty confident that these are used to tell phpMyAdmin which<br>
server, database, and table are currently active. For instance, after<br>
copying a table to a new database, the user may wish to switch to the<br>
newly copied one instead of staying on the same page; these functions<br>
facilitate that change.<br>
<span class=""><br>
> Then this is not required in my case and I can simply ignore these.<br>
<br>
</span>Sure, that sounds correct.<br>
<br>
I think all of your other questions have been answered by the others, so<br>
let me know of course if there's anything I missed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Isaac<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Developers mailing list<br>
<a href="mailto:Developers@phpmyadmin.net">Developers@phpmyadmin.net</a><br>
<a href="https://lists.phpmyadmin.net/mailman/listinfo/developers" rel="noreferrer" target="_blank">https://lists.phpmyadmin.net/<wbr>mailman/listinfo/developers</a><br>
</div></div></blockquote></div><br></div>