It sounds like you might have some stray ' characters in your text....
You didn't give much information, but let me see if I can't figure out kinda
what your doing...
Your using perl, so I assume your going to be using DBI. In DBI you have
your statement handles, or do statements. That means your inserts are going
to be one of two ways:
$dbh->do('query');
or:
$sth = $dbh->prepare('query');
$sth->execute();
Whichever way your doing it, use the prepare method, I'll show you why.
When you do a prepare, you can put in things called placeholders, so if you
needed to insert into table_a 2 values ($header,$body) you would do this:
$sth = $dbh->prepare('INSERT INTO table_a VALUES (?,?)'); #Note the ?'s are
the placeholders
$sth->execute($header,$body); #The arguments passed to execute go into the
placeholders
What this does is it has DBI automatically escape out special characters,
because it knows exactly where they need to go.
If neither of these are the case, please give us some more information (the
code where your inserting the data etc..)
----- Original Message -----
From: "Chris Herold" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 26, 2001 10:26 PM
Subject: RE: MySQL question
> hi--
>
> firstly, I am relatively new to mysql.
>
> I am having a problem getting text I enter into a perl script (for reasons
> of parsing and sending to my mysql database) to consistently get entered
> into the database.
>
> the perl script takes a mail message and makes the body of the message
> "$body". It then pulls the first bit of the body to make the "$header"...
> this is then written to the database. All very simple.
>
> when i run a simple text body through the program it is picked up, parsed
> and correctly sent to the mysql database table specified. When I try a
> number of other texts of same or very similar formats, I found that only a
> quarter to a half of them get written to the database.
>
> this is very confusing because I have it set upin the perl script that all
> the parsed values ($body and $header) are e-mailed to my address so I can
> confirm the script worked correctly on the text in question.
>
> And in every case it did ... based on the e-mail.
>
> So then, why am I getting selective acceptance of data strings into my
mysql
> database?
>
> Is this something that others have suffered with that you may be able to
> help me with?????
>
> As a note: the mysql I use is run through PhpMyAdmin.
>
> thanks,
>
> chris herold
> [EMAIL PROTECTED]
> 858-534-5875
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php