‘Insert php, can’t pass its variable to Rawjs
-
Hello, I’m having problem passing PHP variable to javascript(Rawjs).
I’ve successfully got data from Mysql and display in HTML .
But my main goal is to assign the data to js variable. Computed like this
Rawjs
[wbcr_php_snippet id="8091"] <script> var b="[wbcr_php_snippet id="8101"]"; </script>wbcr_php_snippet id=”8091″]
$query= "select meta_value from wp_gf_entry_meta where meta_key=38"; if ($result = mysqli_query($conn, $query)) { while ($row = mysqli_fetch_array($result)) { $getii = $row[0]; } mysqli_free_result($result); }[wbcr_php_snippet id=”8101″]
echo $getii;Have done a lot of research but cant figure out why
var bin Rawjs always get 0
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘‘Insert php, can’t pass its variable to Rawjs’ is closed to new replies.