Mysql.new = Este es el alias del metodo Mysql.real_connect
Ejemplo:
Mysql::new("host", "usuario", "contraseña", "base de datos", puerto(opcional)
Mysql#query = Este metodo es para enviar todos los comandos SQL de MySql
is an alias to the Method . We pass the host where the MySQL server is running and the username and the password of the root user to the constructor. Then we create the database with the . We pass this method the SQL code to create the database. Then we have to call Mysql#select_db. You always have to select a database before you can work on it like inserting data or creating tables as we do here. (This is like "use sampledb" within an interactive mysql session.
No hay comentarios.:
Publicar un comentario