Advertisement
ikamal7

m8.php

Sep 6th, 2020
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <?php
  2. //MySQL Update data
  3. $host = 'localhost';
  4. $user = 'root';
  5. $password = 'root';
  6.  
  7. $db_name = 'basicDB_2';
  8. //students_2
  9.  
  10. $mysql_conn = mysqli_connect( $host, $user, $password, $db_name );
  11.  
  12. if ( !$mysql_conn ) {
  13. die( "Connection Failed" . mysqli_connect_error() );
  14. }
  15.  
  16. $sql = "UPDATE students_2 SET firstname='Kamaal', lastname='Hossain', email='kamal@kamal.com' WHERE id=12";
  17.  
  18. if ( mysqli_query( $mysql_conn, $sql ) ) {
  19. echo "Record Updated Successfully";
  20. } else {
  21. echo "Error updating failed" . mysqli_error( $mysql_conn );
  22. }
  23.  
  24. mysqli_close( $mysql_conn );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement