Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost"; //replace with your hostname
- $username="phpmyadmin"; //replace with your username
- $password="1234"; //replace with your password
- $db_name="phpmyadmin"; //replace with your database
- $con=mysql_connect("$host", "$username", "$password")or die("cannot connect");
- mysql_select_db("$db_name")or die("cannot select DB");
- $sql = "SELECT * from TurnonLED"; //replace emp_info with your table name
- $result = mysql_query($sql);
- $json = array();
- if(mysql_num_rows($result)){
- while($row=mysql_fetch_row($result)){
- $json['TurnonLED'][]=$row;
- }
- }
- mysql_close($db_name);
- echo json_encode($json);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement