Skip to content
it4e edited this page Feb 27, 2017 · 2 revisions

Name

<chl/mysql.h>

chl_mysql_db, CHL MySQL database

Declaration

void chl_mysql_db(char * database);

Description

The chl_mysql_db function is used to select a MySQL database to be used.

Arguments

  • database: the database to be used.

Return value

No return value.


Examples

main.c

#include <chl/chl.h>
#include <chl/mysql.h>

int main() {
    chl_set_default_headers();
    chl_print_headers();
    
    // Connect to MySQL server, leave database as NULL
    chl_mysql_connect("localhost", "user", "pass", NULL);
    // We select the database here instead
    chl_mysql_db("database");
    
    chl_mysql_close();
    return 0;
}

As CHL is open-source, people are able to contribute with their own APIs, plugins and code which means that CHL is constantly upgraded and provided with new features. Do you have an idea for a new CHL feature and want to contribute?

See contribute.

Setup. API. Tutorial. Examples. FastCGI.

Clone this wiki locally