Jump to content
xisto Community

Js And Mysql

Recommended Posts

I need help on how to have a mysql value as a JS var.
please post any hints/tips/how to do it. I had been doing it where the JS var = php var for the db data. That's not working it seems.


Well, when i need this kind of functionallity what i do is:
<script type="text/javascript">var Js_StringVar ="<?php echo $php_StringVar; ?>";var Js_NumVar =<?php echo $php_NumVar; ?>;</script>
I don't post any code for date/time vars because until now i don't need it in my code, but i think that it will be something similar.

Best regards,

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.