The next example execute a query on the database then print the result.

con=mysql_init()see"Connect to database"+nlmysql_connect(con,"localhost","root","root","mahdb")see"Execute Query"+nlmysql_query(con,"SELECT Name FROM Employee WHERE Id=1;"+"SELECT Name FROM Employee WHERE Id=3")see"Print Result"+nlseemysql_result(con)mysql_next_result(con)seemysql_result(con)see"close database"+nlmysql_close(con)

con=mysql_init()See"Connect to database..."+nlmysql_connect(con,"localhost","root","root","mahdb")See"Read data from database..."+nlmysql_query(con,"SELECT data FROM photo WHERE id=1")See"Write new file"+nlresult=mysql_result(con)write("tests\mahmoud2.jpg",result[1][1])See"Close database..."+nlmysql_close(con)