mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
changed svn layout
git-svn-id: svn://ultimatepp.org/upp/trunk@281 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
commit
d2b54f7989
2872 changed files with 670392 additions and 0 deletions
11
reference/SQL_MySql/SQL_MySql.upp
Normal file
11
reference/SQL_MySql/SQL_MySql.upp
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
description "Logging to MySql";
|
||||
|
||||
uses
|
||||
MySql;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "MT";
|
||||
|
||||
18
reference/SQL_MySql/main.cpp
Normal file
18
reference/SQL_MySql/main.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <MySql/MySql.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
MySqlSession session;
|
||||
// substitute your 'username' and 'password' here:
|
||||
if(!session.Connect("username", "password", "mysql", "localhost")) {
|
||||
printf("Can't connect with MySql\n");
|
||||
return;
|
||||
}
|
||||
Sql sql(session);
|
||||
sql.Execute("use mysql");
|
||||
sql.Execute("show tables");
|
||||
while(sql.Fetch())
|
||||
Cout() << (String)sql[0] << '\n';
|
||||
}
|
||||
Loading…
Reference in a new issue