[Phpmyadmin-devel] Passing a php varable to the javascript

Marc Delisle marc at infomarc.info
Wed Jan 29 14:49:59 CET 2014

Viduranga Wijesooriya a écrit :
> Hi all,
> I want to pass the mysql version "PMA_MYSQL_STR_VERSION" to the javascript.
> Is there a special way that phpmyadmin uses to do that ?
> Thank you

Hi Viduranga,
Maybe you should pass PMA_MYSQL_INT_VERSION instead, it will be easier 
to work with.

I see two ways. First, refer to [0]; you could add a parameter there.

Another way could be to add a class to the input field on which you want 
to work, for example a class "frac_seconds". You do that at the PHP 
level, where you have access to PMA_MYSQL_INT_VERSION. Then at the 
JavaScript level, you use jQuery to verify the presence of this class 
and act accordingly.


Marc Delisle
http://infomarc.info | http://phpmyadmin.net

More information about the Developers mailing list