mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
Adding uppdev....
git-svn-id: svn://ultimatepp.org/upp/trunk@328 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc9f782ba5
commit
4a1c627474
2823 changed files with 619073 additions and 0 deletions
10
uppdev/SQL_MySql/SQL_MySql.upp
Normal file
10
uppdev/SQL_MySql/SQL_MySql.upp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
description "Logging to MySql";
|
||||
|
||||
uses
|
||||
MySql;
|
||||
|
||||
file
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "MT";
|
||||
19
uppdev/SQL_MySql/main.cpp
Normal file
19
uppdev/SQL_MySql/main.cpp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include <MySql/MySql.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
MySqlSession session;
|
||||
// substitute your 'username' and 'password' here:
|
||||
if(!session.Connect("root", "koblih", "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