at July, 22nd from 7am approx. till 4pm
BRexx API for accessing MySQL databases. Prior to version 2.1.x the MySQL API was included as a compile option when compliling the interpreter. From version 2.1.x, MySQL can be compiled as static with the brexx program or as a shared library that has to be imported to the interpreter before use with the command CALL import "librxmysql.so".
ends the connection to the MySQL server. Doesn't return anything
connects to a MySQL server. Returns "0" if ok, otherwise the error number. Use the dberror to find the error.
dbconnect('localhost','root','rootpsw','mysql') /* connect to the mysql db */ dbconnect('localhost',,,'test') /* open the test db */
Returns the error number for the most recently invoked MySQL function. "0" if everything is Ok. Use the option "A" to get the error message.
dberror() /* '0' */ dberror("A") /* 'Cannot connect...' */
Escapes special characters in a string for use in a SQL statement taking into account the current charset of the connection. Use this function when you want to manipulate BLOB fields or strings with non-ascii characters.
Returns information on the fields resulted from last query. With no options returns the number of fields returned (same as the DBINFO("F"). Indexing to a field can be down with the number or the name of the field.
Options Name name of the field (default) Default default value of the field Type type of the field Key is the field the primary key Length length of field Maxlength maximum allowable size of data for field Null if the field is defined as NOT NULL Autoincrement is the field autoincrement Flags the field flags
dbfield() /* 5 */ dbfield(1) /* Name */ dbfield('Name','T') /* String */ dbfield('Name','A') /* 0 */
return the value of the row row and col column number or name column name. Use the DBISNULL() to find out if the returned value is NULL.
dbget(2,5) /* 'hello' */ dbget(2,"Name") /* 'test' */
return "1" if the value of the row row and col column number or name column name is NULL.
dbisnull(2,5) /* 0 */ dbisnull(2,"Name") /* 1 */
returns information about the last operation. Number of Rows, the number of Fields, or the last autoincrement Insert id. Use the dbinfo("R") to return the number of affected rows from the last operation (like, delete, update ...). Use the dbinfo("F") to check if the last operation returned data.
dbinfo('R') /* 5 */ dbinfo('F') /* 10 */ dbinfo('I') /* 1023 */
Executes a SQL query specified as a sqlcmd string. Returns the number of affected rows.
dbsql('select * from test',2) dbsql('insert into test set (name="Vasilis")') dbsql('select last_insert_id()')