Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //MySQL Update data
- $host = 'localhost';
- $user = 'root';
- $password = 'root';
- $db_name = 'basicDB_2';
- //students_2
- $mysql_conn = mysqli_connect( $host, $user, $password, $db_name );
- if ( !$mysql_conn ) {
- die( "Connection Failed" . mysqli_connect_error() );
- }
- $sql = "UPDATE students_2 SET firstname='Kamaal', lastname='Hossain', email='kamal@kamal.com' WHERE id=12";
- if ( mysqli_query( $mysql_conn, $sql ) ) {
- echo "Record Updated Successfully";
- } else {
- echo "Error updating failed" . mysqli_error( $mysql_conn );
- }
- mysqli_close( $mysql_conn );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement