Hi all.
I have a script that read files content and save it on mysql db.
I have noticed that some files are not saved but I don't get any error from mysqlor php.
I turn the each file to a big string and store it as a row in the db.
I've used the function addslashes() before the storing and it solved most of the problems but still some strings are not stored.
The files are too big and I don't know which character is causing the problem (size of string is not the problem).
Any other functions besides addslashes that can help me?
Thanks....
getting all data in mysql
Moderator: General Moderators
Do you have your error reporting bumbed up to max? Are your magic_quotes_gpc set to on or off?
Code: Select all
if (!get_magic_quotes_gpc()) {
echo 'You should use addslashes()';
} else {
echo 'You should NOT use addslashes()';
}Just had some thoughts that could be the issue of your problem.
Meaning, that if you then decide to use stripslashes on it, double '\'' becomes a single ''', and that could break it.
Example:PHP Manual wrote: magic_quotes_gpc boolean
Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all ' (single-quote), " (double quote), \ (backslash) and NUL's are escaped with a backslash automatically.
Code: Select all
$filename "foofoo'foofoo";
// if magic_quotes_gpc = 0
echo addslashes($foo);
// foofoo''foofoo - ok, now will work with stripslashes
// if magic_quotes_gpc = 1
echo addslashes($foo);
// foofoo\\''foofoo - not ok, as magic_quotes allready added the \ you are adding additional \''s