How do I include dots (.) in values to be sent to the MySQL DBI driver? For instance, the following snippet doesn't work...
$sth->prepare('INSERT INTO tablename SET value=?');
$sth->execute('hello.world');
It's nothing to with connecting, disconnecting, error handling and stuff, I'm more than happy with those, it's beacuse, in SQL, 'hello.world' means 'the value of the hello column in the world table'.
If I quote it, like $sth->execute("'hello.world'"); I end up with the quoted value (including quotes) in the database.
In reply to DBI dots
by Merlin83
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.