10 messages in com.mysql.lists.javaRe: MAY DAY! MAY DAY!! Clarify :datat...| From | Sent On | Attachments |
|---|---|---|
| Mehdi Ali Khan | 22 Dec 1999 03:44 | |
| Willy Gielen | 22 Dec 1999 03:53 | |
| pri...@pspl.co.in | 22 Dec 1999 04:03 | |
| Benjamin Pflugmann | 22 Dec 1999 05:14 | |
| Jochen Wiedmann | 22 Dec 1999 10:05 | |
| Tim Endres | 22 Dec 1999 20:59 | |
| Willy Gielen | 23 Dec 1999 00:26 | |
| Roland Becker | 23 Dec 1999 00:54 | |
| Christian Schweingruber | 23 Dec 1999 03:27 | |
| Jochen Wiedmann | 23 Dec 1999 14:08 |
| Subject: | Re: MAY DAY! MAY DAY!! Clarify :datatype TEXT/BLOB![]() |
|---|---|
| From: | Jochen Wiedmann (jo...@ispsoft.de) |
| Date: | 12/23/1999 02:08:49 PM |
| List: | com.mysql.lists.java |
Willy Gielen wrote:
I think the problem is simply that your text contains a single quote ('), which tells mysql that your text is finished ad this point. Everything after that he can't decipher. A simple way to prevent this from happening is before writing your SQL statement, you can replace all quotes with another character or string (for example §§). When you read back the record, you replace the chosen string with the original quote.
Horrible! :-)
You need no replacements or something similar. All you need is quoting the special characters with a backslash. As in
insert into foo values ('Tim o\'Reilly')
With DBD::mysql use either of
$name = "Tim o'Reilly"; $dbh->do("insert into foo values (" . $dbh->quote($name) . ")");
or
$dbh->do("insert into foo values (?)", undef, $name);
Bye,
Jochen
Willy
Quintessence Consulting GmbH, Willy Gielen - wgie...@quintconsult.net Kopernikusstrasse 26, 30853 Langenhagen Tel. +49 (511) 7245 666 - Fax: +49 (511) 7245 667
-----Original Message----- From: Mehdi Ali Khan [mailto:mame...@hd2.dot.net.in] Sent: Mittwoch, 22. Dezember 1999 12:45 To: ja...@lists.mysql.com Cc: deve...@lists.mysql.com; msql...@lists.mysql.com Subject: MAY DAY! MAY DAY!! Clarify :datatype TEXT/BLOB
Hi Everybody,
We want a clarify from you
1)
We created a table xx as follows
create table xx( x1 char(10), x2 text)
Supose we want to insert a text of size containing 500 characters into that table with a query statement
"insert into xx values('123456789x','The Brooklyn Tabernacle has become world famous as a church of miracles a church that has flourished amidst the poverty and crime of one of Brooklyn's harshest most unforgiving neighborhoods. A place where professional men and women former prostitutes pimps drug addicts homeless people and transvestites gather to worship their powerful and merciful God. Fall on Your Knees is a book that will lead you on a journey to spiritual awakening. In it Jim Cymbala pastor of he Brooklyn Tabernacle shares')"
it shows error as follows
parse error near 's harshest most unforgiving neighborhoods. A place where professional men and wo' at line 1
But from your manual data type TEXT supports maximum of 655535 characters TEXT and BLOB A `TEXT'/`BLOB' with max length of L+2 65535 characters.
Why it won't support here.
we also tested with change of TEXT datatype to BLOB. But same problem.
Is there any wrong in the query statement.
2)
We faced problem for creating a database with password protection
WeI execute following query in mysql database
"insert into user values('localhost','mak',password('mak10'),'Y','Y','Y','Y','Y','Y','Y','Y',' Y','Y')"
Also we executed mysqladmin reload at command prompt after executing the above query
But we are unable to enter to the user with mysql -u mak -p it asks password
But it shows the error "Access denied for User: 'mak@127.0.0.1' (Using password:YES)"
we followed according to manual.
we are using mysql 3.21.29a-gamma for win32-3.21
Please reply with clear explanation.
Thanks KSatyanarayana
---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail
msql...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail msql...@lists.mysql.com instead.




