Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $servername = "localhost";
  2. $username = "root";
  3. $password = "";
  4. $dbname = "maindata";
  5. // Create connection
  6. $conn = mysqli_connect($servername, $username, $password, $dbname);
  7. // Check connection
  8. if (!$conn) {
  9. die("<center>Connection failed: " . mysqli_connect_error() . "</center");
  10. }
  11.  
  12. $id = $_POST['id'];
  13. $aname = $_POST['aname'];
  14. $xsummary = $_POST['xsummary'];
  15.  
  16. $sql=mysql_query("SELECT * FROM info WHERE ID = $id");
  17.  
  18. if (mysql_num_rows($sql) == $id)
  19. {
  20. $sql="update info set AccountName= '$aname', ExecutiveSummary='$xsummary'";
  21. }
  22. else {
  23. $sql="insert into AccountName= '$aname', ExecutiveSummary= '$xsummary'";
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement