If nothing happens and there are no errors, it might mean that the data was inserted successfully but you didn’t receive any confirmation. To ensure everything is working as expected, you can verify the insertion by querying the database to check if the new data is present.
I will suggest to add some condition statements to make sure that the execution was successful -
1.Check Database connection: Ensure that the connection to the database is successful.
conn = database('kk2', 'root', '');
if isopen(conn)
disp('Connection successful');
else
disp(['Connection failed: ' conn.Message]);
end
2. Execute the Query Manually: Before using the query in your script, manually execute it in the MySQL command line or a database management tool to ensure it works as expected.
3. In the script, print the output of "exec" to verify the successful query execution.