[fpc-pascal] Insert into ... mysql

Henry Vermaak henry.vermaak at gmail.com
Sun Jun 28 22:51:26 CEST 2009


2009/6/28 César Espinoza <cesarespinozasoto at gmail.com>:
> Hi all  !!
>
> I did! I can now connect and query to mysql
>
> fpc 2.2.4, console, Macosx 10.5 leopard, Mac book Intel
>
> But I can't (may be I dont know :-( ) insert data in a table
> ------------
>  connect mysql  ... ok
>   select db ... ok
> .....
>   new(consulta);
>   consultastr:='INSERT INTO lugares (lugar) values (''Sala'')';
>   strPCopy(consulta,consultastr);

Is there enough space allocated for consulta to take
length(consultastr)+1?  Why don't you just use:

mysql_query(sock,PChar(consultastr))?

Henry



More information about the fpc-pascal mailing list