Boost logo

Boost Users :

From: loufoque (mathias.gaunard_at_[hidden])
Date: 2006-09-12 14:31:26


Paul Davis wrote :

>
> id = "2 ; delete from persons ;"
>
> sql << "select first_name, last_name, date_of_birth "
> "from persons where id = " << id
>
>
> Someone just deleted your persons table. Oops.

In my example sql was supposed to be a special stream type overloaded to
escape types correctly. I thought SOCI worked that way, but in fact it
seems it is not the case.

You could do this, though

std::string name;
sql << "select phone from phonebook where name = :name",
     use(name);


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net