--- Daniel Kasak <[EMAIL PROTECTED]> wrote:
> Abs wrote:
> 
> >mysql and php question:
> >the magic_quotes_gpc is set to 1. when i echo it to
> >the browser, it shows the added slashes. i inserted
> >these same values into a database. when i read the
> >database values and printed them, i forgot to use
> >stripslashes. but i was surprised to see that the
> >slashes were already removed. now i know this
> depends
> >on magic_quotes_runtime, which i checked, was OFF,
> so
> >how did the slashes get removed without me
> explicitly
> >doing so?
> >
> >what's more interesting is that when i view the
> data
> >in the table using phpMyAdmin, the quote i put
> wasn't
> >escaped with a backslash. when i tried to do a
> >dump/export of the table, the output showed a
> >backslash before the quote. so how come? the
> slashes
> >should be showing when i say SELECT * FROM MYTABLE.
> >
> >abs
> >  
> >
> 
> I think this is why people recommend that you
> *don't* use PHP's magic 
> quotes.
> I hit this problem in a few areas and decided to
> turn it off.
> 
> Use PHP's functions:
> 
> stripslashes() and
> addslashes()
> 
> You'll be sorry later if you don't, and continue
> using magic quotes...
> 

that still doesn't answer the question though. if the
variables already had the slashes in them because of
magic_quotes_gpc, then shouldn't the table i inerted
it into also have the slash in it?
magic_quotes_runtime ADDS slashes if it is ON, so it
leaves the data untouched if it's OFF (if this is
incorrect, the documentation needs to be updated).

hence, when i retrieved the data from the db, the
quotes should have still been there. and the o/p to
browser, phpMyadmin (and macromedia dreamweaver's
"test" window) all don't show any slashes in the data,
but 'export' in phpMyadmin adds slashes to the text it
outputs.
magic_quotes_gpc is On
magic_quotes_runtime is Off
magic_quotes_sybase is Off (to be sure)

another thing that comes to mind is...
does mysql store the data in the .tbl/.frm files in
their text form? or is the slash we add there "just"
to tell mysql to disregard the significance of the
next character? the 2nd one seems logical considering
that mysql would read data per column in the specific
size it's supposed to be (and not pay attention to the
mean of what it's reading). so if a varchar(50) column
has the data: `qwer'y\19o` then it knows that it
should read and return 10 chars/bytes.

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to