I've found that using PreparedStatement.setString() takes care of any
apostrophe's within a given sql string field.
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/
* Jonathan Hilgeman
> So something like Joe's Farm will look like Joe's Farm. It gets
> inserted into the database without any addslashes, and when you
> retrieve it from the database, it should work fine without any
> converting to this or that.
...and when you search the database, you must do t
from the database, it should work fine without any converting to this or
that.
- Jonathan
-Original Message-
From: Tim Thorburn [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 08, 2002 7:11 PM
To: [EMAIL PROTECTED]
Subject: apostrophe's in PHP & MySQL
Hi,
I've been exper
Sherwin Ang writes:
> another approach is using the str_replace() function, just replace the
> single quote ' with two single quotes '' and database inserts should be
> fine.
Very funny. Let's say you're making this query:
DELETE FROM t1 WHERE str_field = '$value'
with your way of doing things
Tim Thorburn" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, January 09, 2002 11:59 AM
Subject: RE: apostrophe's in PHP & MySQL
> Hi Tim,
> You can get around that proble using AddSlashes() function in PHP. So is
you
> have a text box where the
Thorburn [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 08, 2002 10:11 PM
To: [EMAIL PROTECTED]
Subject: apostrophe's in PHP & MySQL
Hi,
I've been experiencing some sporadic problems with a few web forms written
in PHP 3.0.16 and MySQL 3.23.31 with text fields (both single
t;[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 10:11 PM
Subject: apostrophe's in PHP & MySQL
> Hi,
>
> I've been experiencing some sporadic problems with a few web forms written
> in PHP 3.0.16 and MySQL 3.23.31 with text fields (both single lines and
> rows).
Hi,
I've been experiencing some sporadic problems with a few web forms written
in PHP 3.0.16 and MySQL 3.23.31 with text fields (both single lines and
rows). Generally if any of the text in these forms contains an apostrophe
- either nothing is entered into the database, or nothing after the