whoisquilty wrote:
> 
> 
> --- In php-list@yahoogroups.com <mailto:php-list%40yahoogroups.com>, 
> Mladen Milankovic <[EMAIL PROTECTED]> wrote:
>  >
>  > On Tuesday 25 March 2008 21:44:56 whoisquilty wrote:
>  > > When I insert into my database from a form, there are slashes added 
> before
>  > > quotes. What do I need to do to get rid of this?
>  >
>  > Hi.
>  >
>  > It sound like you have problems with magic quotes. Open your php.ini 
> file and
>  > search for magic_quotes and turn them all off. This way you'll have 
> total
>  > control over your data. :)
>  >
>  > regards
>  > mmlado
>  >
> 
> I don't think I've got access to it. I'm not the admin of my server.
> 

Assuming that you have an int primary key named id, you could do 
something like this:

$q = mysql_query("SELECT * FROM table WHERE column LIKE '%\"%');
while($row = mysql_fetch_assoc($q)){
   foreach($row as $k => $v) $v = str_replace('\"','"',$v);
   mysql_query('UPDATE table SET '.implode(',',"$k = '$v'").'WHERE id = 
'.$row['id']) or die(mysql_error());
}

There are probably easier ways of doing this, but this is the first off 
the top of my head.

FYI, I have not tested or debugged this code.

bp

Reply via email to