Advertisement
Guest User

Untitled

a guest
Mar 4th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "root";
  4. $password = "";
  5. $dbname = "test";
  6.  
  7. $autoid = $_REQUEST["autoid"];
  8. // $explanation = htmlspecialchars($_REQUEST["explanation"]);
  9. $explanation = mysql_real_escape_string("<p>hello how are you Ê</p>");
  10.  
  11.  
  12.  
  13. echo $explanation;
  14.  
  15. // Create connection
  16. $conn = new mysqli($servername, $username, $password, $dbname);
  17.  
  18. //$explanation = utf8_decode(trim(mysql_real_escape_string($explanation));
  19. // Check connection
  20. if ($conn->connect_error) {
  21. die("Connection failed: " . $conn->connect_error);
  22. }
  23.  
  24. $sql = "UPDATE question_master SET explanation='$explanation' WHERE autoid=$autoid";
  25.  
  26. if ($conn->query($sql) === TRUE) {
  27. echo "Record updated successfully";
  28. } else {
  29. echo "Error updating record: " . $conn->error;
  30. }
  31.  
  32. $conn->close();
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement