03-23-2017, 09:58 AM
Yeah. Because javascript is a client side language, it does not have direct access to the database, although you can get a little sneaky.
So what you probably want to do is to write a function in javascript or php to make that happen.
I'm not a wizard but off the top of my head you would make a function like
function testVar($column){
//your test_var call with $column passed into the url
}
Then when you call the function it would be
testVar($user->data()->MyOwnColumn); in php
or something like
testVar(<?=$user->data()->MyOwnColumn?>); in js
Maybe with quotes around the php variable in javascript. I don't have my sample code with me right now.
So what you probably want to do is to write a function in javascript or php to make that happen.
I'm not a wizard but off the top of my head you would make a function like
function testVar($column){
//your test_var call with $column passed into the url
}
Then when you call the function it would be
testVar($user->data()->MyOwnColumn); in php
or something like
testVar(<?=$user->data()->MyOwnColumn?>); in js
Maybe with quotes around the php variable in javascript. I don't have my sample code with me right now.