Jump to content

Recommended Posts

I run data through mysql_real_escape_string() before using implode() but implode() is removing 1 of the \ after mysql_real_escape_string() has put them in.

 

If anyone you could let me know how i could stop this i would be great.

 

Thanks

Edited by richiejones24

MySql Values after implode() '140 Church Street','St John\'s Wood','London','NW8 8EX'

MySql Values before implode() '140 Church Street','St John\\'s Wood','London','NW8 8EX'

 

The Code


while ($f < count($AddressSplitBus))
{
$AddressSplitBus[$f] = trim($AddressSplitBus[$f]);
$AddressSplitBus[$f] = mysql_real_escape_string($AddressSplitBus[$f]);

$f++;
}

//Create the Values to insert into DB
$MysqlValuesBus = implode("','", $AddressSplitBus);
$MysqlValuesBus = "'$MysqlValuesBus'";
$NumberValsBus = count($AddressSplitBus);

 

Again Thanks for the help guys

Edited by richiejones24

Your values before the implode should look like the values that you get after. It looks as though you are escaping data that has already been escaped. Have you checked that magic_quotes are not on?

Right, this code proves nothing other than you still say something which most of us think is impossible.

 

Barand is right, this data is already escaped by something. Though that has no bearing on implode()

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.