Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Apostrophes Turning Into Question Marks?


This may be easily resolved but I haven't ever encountered it before. I am entering text into my mysql database that contains apostrophes. This field is generally around 500-800 characters. When I add the information, there are apostrophes but when I go back to use the information, all of the apostrophes have been changed into question marks.
Any ideas how to keep the apostrophes? or why they are being changed?
Also, if I go through and change all the question marks back to apostrophes, they will stay apostrophes!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
MySQL And Apostrophes
I am doing an INSERT INTO statement to bring in data. So whats the deal ..... i have tried all three below and still no joy, it doesn't like apostrophes no matter what i do.


1. (00000006,Colin,O’Brien,Cork,Irish,000005),

2. (00000006,"Colin","O’Brien","Cork","Irish",000005),

3. (00000006,'Colin','O’Brien','Cork','Irish',000005),


The data types are Code:

MySQL And Apostrophes
I am doing an INSERT INTO statement to bring in data.
So whats the deal ..... i have tried all three below and still no joy, it doesn't like apostrophes no matter what i do.

1. (00000006,Colin,O’Brien,Cork,Irish,000005),
2. (00000006,"Colin","O’Brien","Cork","Irish",000005),
3. (00000006,'Colin','O’Brien','Cork','Irish',000005),

All the text values are varchar (if that makes a difference)

Apostrophes In Table Names
I am having trouble with the following:

if (!get_magic_quotes_gpc()) {
$testName=stripslashes(strip_tags(trim($_POST['ud_testname'])));}
else {$testName=trim($_POST['ud_testname']);}

$nameSquish = str_replace(" ","", $testName);

mysql_query("CREATE TABLE $nameSquish(
ID INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(ID),
myNote TEXT,
myDate DATETIME,
noteBy VARCHAR(50))")
or die(mysql_error());


When I try to put in a name with an apostrophe (i.e. O'Reilly) in it the following error is given:

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''Reilly( ID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(ID),

However when I do a echo $nameSquish before the SQL query, it comes back with:

SToring Apostrophes In MySQL
and i have a GUI database i am working with provided by my hosting company ...i believe v.5.0...with a PHP Admin interface....

i have a form that submits data to the database and gets rejected when the -Comments- section of my form has either an 'Apostrophe' or "Quotations"... i have the field set a TEXT and it still gets rejected... i tried setting it to BLOB, and no luck.

Removing Quotation Marks
Say you had a column with character data that contained quotation marks. How would you update this column to remove the quotation marks? update table set description = replace(description, 'xx', 'xx') but instead of the x's replace quotations " with nothing since you cant put the quotes directly into the first parameter of the replace function?

Use Quotation Marks In Insert Into Command String?
how to make SQL command with cuotation marks for example
INSERT INTO some_table (name, pet) VALUES ( ' Petar's ' , ' dog ')
is there any way to put quotation marks inside the string, or should I make some statements for chechking if the string has quotes and replace them????

Double Quote Marks In SQL Backup File
when I do a backup of a table on my mySQL Administrator I get CREATE TABLE "product" (double quotes), I want product` (single quote marks) where do I specify this I tried all I can imagine already to do with character set..and backup options
(this messes up on restore with double quotes on DB I need to add this to..

String Error - Quotes Changed To Question Marks
I recently converted an asp/access site to an asp/mysql site. Now all my strings are displaying funky. For example if I have the text - Why don't we say "Yipee" - it displays on my site as - Why don?t we say ?Yipee?. The same change is being made when I use a sentence with "..." in it. I like ... baseball is changed to - I like?baseball.

Any thoughts as to why this is happening? Sometimes it is actually being changed somehow in the database, and sometimes it is correct in the database, but then changed when it displays on the web.

Turning Mysql Off On Mac?
My friend is running OSX and has mySQL running, she doesn't know why its running or how it got there, how do you turn it off? What are the steps to go through?

Turning A Column Into A Row
Is there a was to take tableA with this data:
Letter ID
A 1
B 2
C 3

And insert it into TableB like this:

ABC

Turning On Logging
I have a database that has various information submitted to it from the internet. I am having problems with people hacking/submitting info that shouldn't be submitted. I don't know how they are doing it but I though that if I turned on the Logging for that particular DB maybe it would give me some clues i.e. IP addresses, ISP, date/time info, SQL Statement executed etc.What form of logging would I need to turn on?

MySQL Is Adding Quotation Marks When Uploading Tab-delin. .txt File
In the Excel sheet, the data looks like:

Data that is going into a page.

and is coming out

"Data that is going into a page."

It doesn't seem to be causing errors, but the formatting looks like crap.

Turning Off Foreign Key Checks
Is it possible to temporarily turn off foreign key checks in a db? I know how to do it from the mysql prompt but I have a number of scripts using Java, etc which seem to be breaking because of the table ordering with respect to foreign keys does not seem to be honored (tables with FKs are declared before the tables the keys refer to).

If there was some way to turn off checking for a db, run all the creation and import scripts I have, then turn the checking back on it would save a ton of effort.

Turning On Slow Query Logging?
Background: I paid a young admin set me up on a database server. He installed the basic I needed for the server...at my request...No Cpanel...mysql and apache and some tight security w/o even a domain name to SSH into. Unfortunately, he's a busy kid, and teens sometimes don't realize that people depend on them...and well, I can't really seem to get him to do much so I gave up and figured it's a good way to force me to learn all this myself...
Well anyway, now I want to turn on Slow Query logging. But before I do that, I need to know how MySQL is running. Is SQLogging turned on already? Where is it logging to? So first thing I want to look up is, when the server is rebooted, what's the command to restart mysql? No clue. How do I change the setting? And of course, the server is production, so when I make the change, it needs to be quick, it needs to be smooth, and I need to be able to roll back to the previous config if necessary.
I'm running Redhat Enterprise.

Turning Localhost To A Network Server
I have a small home network with two computers. On my computer I am running MySQL 4.1.21-community as localhost. I have only be using this for development work.

My husband wants to learn SQL so I would like to be able to have Mysql Query Browser installed on his machine, with him accessing all the databases I have set up on my machine.

How do I go about giving him access to my databases?

My machine runs Windows XP and his runs Windows 2000.

Turning Off Allowing Multiple Non-unique Rows
I feel lazy and I am busy so i don't want to fix my perl code to only alllow insertion of unique rows. I know mysql is set to allow multiple rows of the same thing but I would like to turn that feature off. Is that possible?

How To Universally Act On All Cells In A Table, Turning Blanks To NULLS
i should be able to do this, but it's actually been a pain for a while. how can i turn all the blanks in a table to NULLS?


Copyright © 2005-08 www.BigResource.com, All rights reserved