hab aus diesen tagen noch so nen bsp-quellcode rumliegen. wenn du damit etwas rumexperementierst, wird die die sache ganz schnell klar.
#pragma comment(lib, "wsock32.lib")
#pragma comment(lib, "libmySQL.lib")
//die includes sieht man wegen html irgendwie net
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define WIN32_LEAN_AND_MEAN
int main()
{
MYSQL* mysql; //handle
MYSQL_ROW zeile; //speichert eine zeile
unsigned int anzahl_felder; //anzahl felder ;)
unsigned int i;
MYSQL_RES* result; //ergebnis
mysql = mysql_init(NULL);
mysql = mysql_real_connect(mysql, "localhost", "APItestuser", NULL, "db1", 0, NULL, 0);
if(mysql!=NULL)
{
if (mysql_query(mysql,"SELECT * FROM users")==0)
{
result=mysql_store_result(mysql );
if (result!=NULL)
{
anzahl_felder = mysql_num_fields(result);
while ((zeile = mysql_fetch_row(result)))
{
for(i = 0; i < anzahl_felder; i++)
{
printf("%s ",zeile[i]);
}
printf("\n");
}
}
}
}
return 0;
}
mfg ludi
geschrieben von ludi86 , 30.10.2003, 09:47 Uhr , 27 mal gelesen