Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #26706

Re: Ansi C and MySql - II topic…variables

From Gareth Owen <gwowen@gmail.com>
Newsgroups comp.lang.c
Subject Re: Ansi C and MySql - II topic…variables
References <k3seks$n0q$1@nnrp-beta.newsland.it> <k3sjam$90p$1@dont-email.me> <k3slml$rep$1@nnrp-beta.newsland.it>
Date 2012-09-26 06:28 +0100
Message-ID <87ipb1nyi4.fsf@gmail.com> (permalink)

Show all headers | View raw


sim <simisa@tiscalinet.it> writes:

> Now I have another problem, I am creating a Query to update datas into
> MySql…I don't know how to put into Query the variables……….

Basically, that depends on whether the data can be updated as ASCII or
binary blobs. Basically, you need to build up a string (char *)
containing your query -- then maybe call mysql_escape_string() -- then
pass that to mysql_query() or mysql_escape_query()

In either case, C is a pretty grim choice of language to do this in, as
dynamic string building (without a third party library) is horribly
error prone for new programmers, and merely horribly unpleasant for
everyone else. 

Even the flawed C++ std::string would make this an order of magnitude
easier.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Ansi C and MySql sim <simisa@tiscalinet.it> - 2012-09-25 16:21 +0200
  Re: Ansi C and MySql Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-09-25 11:41 -0400
    Re: Ansi C and MySql  - II topic…variables sim <simisa@tiscalinet.it> - 2012-09-25 18:21 +0200
      Re: Ansi C and MySql  - II topic…variables Lew Pitcher <lpitcher@teksavvy.com> - 2012-09-25 13:08 -0400
        Re: Ansi C and MySql - II topic…variables sim <simisa@tiscalinet.it> - 2012-09-26 18:45 +0000
      Re: Ansi C and MySql  - II topic…variables Malcolm McLean <malcolm.mclean5@btinternet.com> - 2012-09-25 12:51 -0700
        Re: Ansi C and MySql  - II topic…variables Greg Martin <greg@softsprocket.com> - 2012-09-25 13:35 -0700
      Re: Ansi C and MySql  - II topic…variables Gareth Owen <gwowen@gmail.com> - 2012-09-26 06:28 +0100
  Re: Ansi C and MySql 88888 Dihedral <dihedral88888@googlemail.com> - 2012-09-25 16:00 -0700
    Re: Ansi C and MySql sim <simisa@tiscalinet.it> - 2012-09-26 12:45 +0200

csiph-web