<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[mysql Datenbankabfrage - Fehler]]></title><description><![CDATA[<p>Erst mal Hallo an Alle,</p>
<p>bin neu hier und auch recht neu im Gebiet der C-Programmierung. Bis jetzt bin ich ja durch suchen und Threads lesen zurechtgekommen. Jetzt habe ich aber ein für mich im Augenblick nicht lösbares Problem:</p>
<p>Ziel: MySQL Datenbank auslesen von einem Linux-Server. (z.B. SELECT * FROM testdb;) Ich benutze übrigens Visual C++ 6.0 Professional</p>
<p>Ich poste mal den code den ich bis jetzt habe:</p>
<pre><code class="language-cpp">#include &lt;mysql.h&gt; //Die mysql.h habe ich ins Basisverzeichniss kopiert!
#include &lt;stdio.h&gt;

void main(){
   MYSQL *mysql;
   MYSQL_RES *res;
   MYSQL_ROW row;
   char *query;
   int t,r;

   mysql_init(mysql);
   if (!mysql_real_connect(mysql,&quot;10.1.8.10&quot;,&quot;root&quot;,
        &quot;&quot;,&quot;cd_handel&quot;,0,NULL,0))
   {
       printf( &quot;Error connectin ot database: %s\n&quot;,mysql_error(mysql));
   }
   else printf(&quot;Connected...\n&quot;);

   query=&quot;select * from artist&quot;;

   t=mysql_real_query(mysql,query,(unsigned int) strlen(query));
   if (t)
   {
      printf(&quot;Error making query: %s\n&quot;,
              mysql_error(mysql));
   }
   else printf(&quot;Query made...\n&quot;);
   res=mysql_use_result(mysql);
   for(r=0;r&lt;=mysql_field_count(mysql);r++){
           row=mysql_fetch_row(res);
           if(row&lt;0) break;
           for(t=0;t&lt;mysql_num_fields(res);t++){
                   printf(&quot;%s &quot;,row[t]);
           }
           printf(&quot;\n&quot;);
   }
   mysql_close(mysql);
}
</code></pre>
<p>Wenn ich den Code kompiliere kommen folgende Fehler:</p>
<pre><code>--------------------Konfiguration: mysql_query2 - Win32 Debug--------------------
Kompilierung läuft...
mysql_query2.cpp
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(116) : error C2146: Syntaxfehler : Fehlendes ';' vor Bezeichner 'fd'
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(116) : error C2501: 'SOCKET' : Fehlende Speicherklasse oder Typbezeichner
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(116) : error C2501: 'fd' : Fehlende Speicherklasse oder Typbezeichner
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(180) : error C2065: 'SOCKET' : nichtdeklarierter Bezeichner
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(180) : error C2146: Syntaxfehler : Fehlendes ')' vor Bezeichner 's'
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(181) : error C2059: Syntaxfehler : ')'
f:\c-programme\datenbankabfrage\mysql_query2.cpp(21) : error C2065: 'strlen' : nichtdeklarierter Bezeichner
f:\c-programme\datenbankabfrage\mysql_query2.cpp(29) : warning C4018: '&lt;=' : Konflikt zwischen signed und unsigned
f:\c-programme\datenbankabfrage\mysql_query2.cpp(32) : warning C4018: '&lt;' : Konflikt zwischen signed und unsigned
Fehler beim Ausführen von cl.exe.

mysql_query2.obj - 7 Fehler, 2 Warnung(en)
</code></pre>
<p>Ich habe auch schon nachgeforscht und einiges getestet. Leider komme ich nicht auf die Ursache. Die mysql.h habe ich von meinen Linux-Server kopiert. Kann das sein das die &quot;defekt&quot; ist? Wenn ja, wo kann ich eine &quot;ganze&quot; downloaden.</p>
<p>Danke Euch für jede Hilfe!</p>
<p>Gruß</p>
<p>Patrick</p>
<p>PS. Hoffe ich habe das richtige Forum erwischt</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/52397/mysql-datenbankabfrage-fehler</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 09:33:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/52397.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 Oct 2003 18:29:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Sun, 19 Oct 2003 18:29:56 GMT]]></title><description><![CDATA[<p>Erst mal Hallo an Alle,</p>
<p>bin neu hier und auch recht neu im Gebiet der C-Programmierung. Bis jetzt bin ich ja durch suchen und Threads lesen zurechtgekommen. Jetzt habe ich aber ein für mich im Augenblick nicht lösbares Problem:</p>
<p>Ziel: MySQL Datenbank auslesen von einem Linux-Server. (z.B. SELECT * FROM testdb;) Ich benutze übrigens Visual C++ 6.0 Professional</p>
<p>Ich poste mal den code den ich bis jetzt habe:</p>
<pre><code class="language-cpp">#include &lt;mysql.h&gt; //Die mysql.h habe ich ins Basisverzeichniss kopiert!
#include &lt;stdio.h&gt;

void main(){
   MYSQL *mysql;
   MYSQL_RES *res;
   MYSQL_ROW row;
   char *query;
   int t,r;

   mysql_init(mysql);
   if (!mysql_real_connect(mysql,&quot;10.1.8.10&quot;,&quot;root&quot;,
        &quot;&quot;,&quot;cd_handel&quot;,0,NULL,0))
   {
       printf( &quot;Error connectin ot database: %s\n&quot;,mysql_error(mysql));
   }
   else printf(&quot;Connected...\n&quot;);

   query=&quot;select * from artist&quot;;

   t=mysql_real_query(mysql,query,(unsigned int) strlen(query));
   if (t)
   {
      printf(&quot;Error making query: %s\n&quot;,
              mysql_error(mysql));
   }
   else printf(&quot;Query made...\n&quot;);
   res=mysql_use_result(mysql);
   for(r=0;r&lt;=mysql_field_count(mysql);r++){
           row=mysql_fetch_row(res);
           if(row&lt;0) break;
           for(t=0;t&lt;mysql_num_fields(res);t++){
                   printf(&quot;%s &quot;,row[t]);
           }
           printf(&quot;\n&quot;);
   }
   mysql_close(mysql);
}
</code></pre>
<p>Wenn ich den Code kompiliere kommen folgende Fehler:</p>
<pre><code>--------------------Konfiguration: mysql_query2 - Win32 Debug--------------------
Kompilierung läuft...
mysql_query2.cpp
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(116) : error C2146: Syntaxfehler : Fehlendes ';' vor Bezeichner 'fd'
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(116) : error C2501: 'SOCKET' : Fehlende Speicherklasse oder Typbezeichner
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(116) : error C2501: 'fd' : Fehlende Speicherklasse oder Typbezeichner
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(180) : error C2065: 'SOCKET' : nichtdeklarierter Bezeichner
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(180) : error C2146: Syntaxfehler : Fehlendes ')' vor Bezeichner 's'
e:\win2k\programme\microsoft visual studio\vc98\include\mysql_com.h(181) : error C2059: Syntaxfehler : ')'
f:\c-programme\datenbankabfrage\mysql_query2.cpp(21) : error C2065: 'strlen' : nichtdeklarierter Bezeichner
f:\c-programme\datenbankabfrage\mysql_query2.cpp(29) : warning C4018: '&lt;=' : Konflikt zwischen signed und unsigned
f:\c-programme\datenbankabfrage\mysql_query2.cpp(32) : warning C4018: '&lt;' : Konflikt zwischen signed und unsigned
Fehler beim Ausführen von cl.exe.

mysql_query2.obj - 7 Fehler, 2 Warnung(en)
</code></pre>
<p>Ich habe auch schon nachgeforscht und einiges getestet. Leider komme ich nicht auf die Ursache. Die mysql.h habe ich von meinen Linux-Server kopiert. Kann das sein das die &quot;defekt&quot; ist? Wenn ja, wo kann ich eine &quot;ganze&quot; downloaden.</p>
<p>Danke Euch für jede Hilfe!</p>
<p>Gruß</p>
<p>Patrick</p>
<p>PS. Hoffe ich habe das richtige Forum erwischt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/375381</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/375381</guid><dc:creator><![CDATA[White-Horse]]></dc:creator><pubDate>Sun, 19 Oct 2003 18:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Sun, 19 Oct 2003 19:20:39 GMT]]></title><description><![CDATA[<p>So, das gleiche C Script auf der Linux über vi.</p>
<p>Dann kommt nach dem kombilieren folgendes:</p>
<p>mysql.c:5: error: <code>mysql' undeclared (first use in this function) mysql.c:5: error: (Each undeclared identifier is reported only once mysql.c:5: error: for each function it appears in.) mysql.c:6: error:</code>res' undeclared (first use in this function)<br />
mysql.c:4: warning: return type of `main' is not `int'</p>
<p>Danke nochmal für jede Hilfe.</p>
<p>Gruß</p>
<p>Patrick</p>
]]></description><link>https://www.c-plusplus.net/forum/post/375408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/375408</guid><dc:creator><![CDATA[White-Horse]]></dc:creator><pubDate>Sun, 19 Oct 2003 19:20:39 GMT</pubDate></item><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Sun, 19 Oct 2003 19:34:54 GMT]]></title><description><![CDATA[<p>auch wenn du im falschen Forum bist:<br />
Bei Windows musst du noch die Socketunterstützung includen.</p>
<p>#include &lt;afxsocket.h&gt;</p>
<p>Solltest du in Zukunft eine Problem haben dann schaue bitte in welches Forum deine Frage passt.<br />
C/C++ != C#;</p>
<p>Bevor du postest benutze die Suchfunktion des Forums. Dein Problem wurde schon x-mal gefragt und beantwortet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/375425</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/375425</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Sun, 19 Oct 2003 19:34:54 GMT</pubDate></item><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Sun, 19 Oct 2003 19:45:52 GMT]]></title><description><![CDATA[<p>Unix-Tom schrieb:</p>
<blockquote>
<p>auch wenn du im falschen Forum bist:<br />
Bei Windows musst du noch die Socketunterstützung includen.</p>
<p>#include &lt;afxsocket.h&gt;</p>
<p>Solltest du in Zukunft eine Problem haben dann schaue bitte in welches Forum deine Frage passt.<br />
C/C++ != C#;</p>
<p>Bevor du postest benutze die Suchfunktion des Forums. Dein Problem wurde schon x-mal gefragt und beantwortet.</p>
</blockquote>
<p>Danke dir.<br />
Hatte schon gesucht aber nix gefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/375432</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/375432</guid><dc:creator><![CDATA[White-Horse]]></dc:creator><pubDate>Sun, 19 Oct 2003 19:45:52 GMT</pubDate></item><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Fri, 21 May 2004 12:36:16 GMT]]></title><description><![CDATA[<p>Hi, ich hab eine Frage, woher bekommen ich die mysql.h und wo müsste ich die dann hintun?<br />
Hab mir von <a href="http://mysql.com" rel="nofollow">mysql.com</a> des mysql++1.7.9 runtergeladen, hab aber keine Ahnung wie ich die einsetze oder was ich damit machen muss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/524577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/524577</guid><dc:creator><![CDATA[Scherrli]]></dc:creator><pubDate>Fri, 21 May 2004 12:36:16 GMT</pubDate></item><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Fri, 21 May 2004 22:22:20 GMT]]></title><description><![CDATA[<blockquote>
<p>Ich benutze übrigens Visual C++ 6.0 Professional</p>
</blockquote>
<p>ja, dann man da auch hin...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/524938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/524938</guid><dc:creator><![CDATA[AndreasW]]></dc:creator><pubDate>Fri, 21 May 2004 22:22:20 GMT</pubDate></item><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Fri, 21 May 2004 22:22:47 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=1033" rel="nofollow">AndreasW</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=28" rel="nofollow">C# und .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=1" rel="nofollow">MFC mit dem Visual C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/524939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/524939</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Fri, 21 May 2004 22:22:47 GMT</pubDate></item><item><title><![CDATA[Reply to mysql Datenbankabfrage - Fehler on Sat, 22 May 2004 06:11:21 GMT]]></title><description><![CDATA[<p>Die mysql++ ist eine Wrapper-Klasse für dioe MySQL-API. Deshalb muss du die MySQL-API auch runterladen.<br />
Du kannst aber auch in die FAQ-MFC schauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/524973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/524973</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Sat, 22 May 2004 06:11:21 GMT</pubDate></item></channel></rss>