-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathh3n.d
33 lines (29 loc) · 730 Bytes
/
h3n.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import mysql;
import mysql_wrapper;
import std.stdio;
import std.c.process;
int main(string[] args){
MYSQL *mysql;
MYSQL_RES *result;
string[string] hash;
string[] array;
mysql = mysql_init(null);
if (!mysql_connect_d(mysql,"localhost","root","sibscana","Video",0,null,0)) {
writefln("Verbindung fehlgeschlagen");
return 0;
}
int i = 0;
//while(true) {
mysql_query_d(mysql, "select * from filme where nr in (1,4)");
result = mysql_use_result(mysql);
//while (( array = mysql_fetch_array(result)) != null) {
while (( hash = mysql_fetch_assoc(result)) != null) {
foreach ( string key; hash.keys.sort ) {
writefln("%s = %s",key,hash[key]);
}
}
writeln();
//}
mysql_close(mysql);
return 0;
}