My friend made a Javascript file that projects a graph of random values it generates from 1-20.
var value1 = (Math.random() * 14).toFixed(0);
I made a PHP file that reads values from an SQL database and assigns that value to $number variable.
How can I assign variable value1 the value of $number.
I tried using:
var value1 = <?php echo json_encode($number); ?>;
but it's not working for me.