Pb d'insertion de fichier txt dans mysql avec visual c++
ateoboss
Messages postés1Date d'inscriptionjeudi 13 mars 2003StatutMembreDernière intervention18 juin 2003
-
18 juin 2003 à 10:47
cs_Bestiol
Messages postés833Date d'inscriptiondimanche 6 janvier 2002StatutMembreDernière intervention 3 novembre 2005
-
24 juin 2003 à 08:43
int main(int argc, char* argv[])
{
pConnection = mysql_init(NULL);
if (!pConnection) //erreur ,on quitte le programme
return 0;
printf ("attente de connect\n");
if(mysql_real_connect (pConnection ,"localhost","root","","PSD",0,NULL,0)==NULL) //erreur
return 0;
printf ("connexion a la base de donnees\n");
/*a voir encore */
//mysql_query(pConnection , " SELECT *FROM 'psd2' ");
mysql_query(pConnection , " LOAD DATA LOCAL INFILE d:/doc_txt/3.txt INTO TABLE psd2 FIELDS TERMINATED BY ; LINES TERMINATED BY \r\n ") ;
//LOAD DATA LOCAL INFILE 'C:\\Program Files\\EasyPHP\\tmp\\phpA371.TMP' INTO TABLE `psd2` FIELDS TERMINATED BY ';' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\r\n'
mysql_close(pConnection);
printf("connection termine\n");
return 0;
}
la connection se fait mais le requete mysql_query ne marche pas.
help me please , je ne sais pas comment faire.
merci d'avance
A voir également:
Pb d'insertion de fichier txt dans mysql avec visual c++