S
Ups, manchmal sollte man halt erst denken
Hab den Fehler schon gefunden, das ganze ist ja CGI
Jetzt gehts.
#include <cstdlib>
#include <iostream>
#include <time.h>
#include <stdio.h>
#include <windows.h>
#include <mysql/mysql.h>
using namespace std;
/* Die Kopfzeile eines Standard-HTML-Dokuments
* Titel: String, der als Titel erscheinen soll
*/
void print_html_header(char *titel)
{
printf("<html><head>\n");
printf("<title>%s</title>\n",titel);
printf("</head><body>\n");
}
/* Das Ende eines HTML-Dokuments */
void print_html_end()
{
printf("</body></html>\n");
}
/* Damit überhaupt ein HTML-Dokument ausgegeben wird */
void print_header()
{
printf("Content-Type: text/html\n\n");
}
int main(int argc, char *argv[])
{
MYSQL_RES *mTabelle;
MYSQL_ROW mRecord;
MYSQL *mConnection, mDB;
int mError;
mysql_init(&mDB);
mConnection = mysql_real_connect(&mDB,"localhost","root","","test",0,0,0);
print_header();
print_html_header("Test");
if (mConnection == NULL)
{
printf("Es konnte keine Verbindung zur Datenbank hergestellt werden: %s \n",mysql_error(&mDB));
return 1;
}
else
{
printf("Es wurde erfolgreich eine Verbindung hergestellt! \n");
}
mysql_close(mConnection);
print_html_end();
//system("PAUSE");
return EXIT_SUCCESS;
}