c++ÖвéѯmysqlÊý¾Ý¿âµÄÎÊÌâ ¼±°¡£¡£¡£¡£¡£¡
ÎÒÔÚc++ÖвéѯmysqlÊý¾Ý¿âʱ
ÎÒÕâÑù×ö¾Í¿ÉÒÔ
char szSqlText[500];
sprintf(szSqlText,"select * from anchorid where xdid='1' and pointid='1' and xdupdw='up'");
µ«ÏÂÃæÕâÑù¾Í²»ÐÐ
char szSqlText[500];
sprintf(szSqlText,"select * from anchorid where xdid='%d' and pointid='%d' and xdupdw='up'",xd_id,anchorid1);
ÕâÊÇʲôÔÒò°¡£¿
ÄܰÑxd_idºÍanchorid1µÃÀàÐÍÌù³öÀ´Âð£¿Èç¹ûËûÃÇÀàÐÍÆ¥Å䣬ËûÃǵÃÖµÒ²ÕýÈ·Âð£¿
Ïëµ½µÃ¾ÍÒÔÉÏÁ½µãÁË
Ó¦¸Ã¾ÍÊÇÀàÐͲ»Æ¥ÅäÁË
int anchorid1='1',anchorid2='2',xd_id='1';
ÔÎ ²ËÄñÁË ¶¨Òå´íÁË ¶àÁ˵¥ÒýºÅ
ÏÖÔÚ¿ÉÒÔÁË ¡£¡£¡£ лл¸÷λ
Ïà¹ØÎÊ´ð£º
ÎÊһϣº
#include <stdio.h>
int main()
{
char x, y, z;
int i;
int a[16];
for(i=0; i<=16; i++)
{
a[i] = 0;
......
ÓÃc/c++¶¨Î»É¾³ýÒ»ÐеÄÎÊÌâ¡£
ÎÊÌâ±³¾°£º
ËùÐèÊý¾ÝÏ൱´ó¡£aÓëbÎļþ¾ùΪһ×éÎļþ£¨a1£¬a2¡£¬b1£¬b2¡£©£¬aÎļþÓÐ×î´óÊý¾ÝÐÐÊý£¨Èç5000£©£¬ÒÔÐеÄÐÎʽ£¬´ÓaÎļþÖжÁÈ¡Êý¾Ý£¬½«aÖв»ÄÜ´¦ÀíµÄÊý¾Ý·ÅÔÚbÎ ......
ÎÒÒÔǰ°²×°ÁËÒ»´Î£¬ºóÀ´Ð¶ÔØÁË£¬ÏÖÔÚÔÙ°²×°µÄʱºò£¬Ìáʾ´íÎó£ºError 1305.Error reading from file C:DOCUME~1\LOCALS~1\Temp\mysql_server.msi.Verify that the file exists and that you can access it.
¿ ......
´ó¼ÒºÃ:
ÎÒÊǸãCµÄ, ÏÖÔÚÏëÓÃC Á¬½ÓMYSQL,µ«ÊÇÔõôҲÁ¬½Ó²»ÁË,ÎҵĴúÂëÈçÏÂ:
#include <stdio.h>
#include "C:\Program Files\MySQL\MySQL Server 5.0\include\mysql.h"
......
ÓÐÒ»ÌõsqlÓï¾ä select a.name ,b.name from tableA a,tableB b where a.id = b.id and ¡£¡£¡££¨ÆäËû¹ýÂËÌõ¼þ£©
ÆäÖÐa.id ΪtableAÖ÷¼ü ÓÐΨһÐÔË÷Òý Êý¾ÝÁ¿²Å1ǧ¶à
b.id ΪÈÕÖ¾±ítableB µÄÍâ¼ü £¬ÂýÈ¥Ìõ¼þµÄ²Å ......