Create a function for set name, user, password for sql database
5 views (last 30 days)
I want to create a file with a function inside for call every time a want to connect to a sql database inside of a script of a gui with manny connection.
Now I use this script to connect to it but when the password it's changed I must to change many places the pass:
conn = database('root', '****', '****');
curs = exec(conn, 'SELECT * FROM prices.prices order by Crt desc limit 200 ');
curs = fetch(curs);
data1 = curs.Data;
clear curs conn
If you could give me an example will be highly appreciated !