How to get the value from a mysql table using php convert to json and then to operate them in javascript?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
18 views
I have a book problem. And the task I need to add notifications. The user specifies the time it is recorded in the database. But when the page loads all data from DB are in json, and from there into an array that checks every 10 seconds if a condition is true (the time specified by the user and present).
by | 18 views

2 Answers

0 like 0 dislike
Primitive, but it's reliable... json_name= you can have in a script to register, then to read it easier
var a = json_name={ name: "+event.target.id+", time: '<?php echo''.$fulluri2.'' ; ?>', c: 'the dog <?php  echo ''.$list.''; ?>' }; var dAnimal = JSON.stringify(a);
by
0 like 0 dislike
The DB connection in PHP.

$mysqli = new mysqli("HOSTNAME","USERNAME", "PASSWORD", "DATABASE"); $mysqli->query("SET NAMES utf8"); $result = $mysqli->query("SELECT * FROM users"); return json_encode($result); // converts received data to JSON
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Apr 22, 2019 by azovl
110,608 questions
257,187 answers
0 comments
40,796 users