Jump to content

[SOLVED] More escaping problems - on UPDATE statement


Recommended Posts

I am rather confused as I have one page that works and this one which appears to be technically the same but will not UPDATE when the update string contains a '.  Works fine when the string has no ' in it.

 

I have checked with echo "$clubwhen1update";  and the ' appears in the string that shows there so it is coming through the form OK and picking up the variable but the UPDATE just does nothing - no error message but data not updated.  Is there anything I can do to get the UPDATE working to put say    Rick O'Shea  as a string into the database (I have no escaping problems when displaying the data so would rather avoid using \ in the database and stripslashes.  Thanks...

 

 

$clubwhen1update =$_POST['clubwhen1update'];

 

$query="UPDATE clubs SET

clubwhen1='$clubwhen1update'

WHERE clubname='$clubnameclicked'";

Cool - that works fine.  Previously I had a problem where it kept adding additional slashes each time users updated but it doesn't seem to do that now.

 

Now I just need to work why how my other page works fine without mysql_real_escape_string()  !!!

 

THANKS

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.