Guest User

Untitled

a guest
Nov 22nd, 2016
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. // Prepare variables for database connection
  4.  
  5. $dbusername = "root"; // enter database username, I used "arduino" in step 2.2
  6. $dbpassword = "sohan"; // enter database password, I used "arduinotest" in step 2.2
  7. $server = "localhost"; // IMPORTANT: if you are using XAMPP enter "localhost", but if you have an online website enter its address, ie."www.yourwebsite.com"
  8.  
  9. // Connect to your database
  10.  
  11. $dbconnect = mysql_pconnect($server, $dbusername, $dbpassword);
  12. $dbselect = mysql_select_db("mp_data",$dbconnect);
  13.  
  14. // Prepare the SQL statement
  15.  
  16. $sql = "INSERT INTO mp_data (flow_rate1) VALUES ('".$_GET["value"]."')";
  17.  
  18. // Execute SQL statement
  19.  
  20. mysql_query($sql);
  21.  
  22. ?>
Add Comment
Please, Sign In to add comment