RE: [PHP] Magic Quotes Issue

2004-12-08 Thread Tim Owens
Shaun wrote: > function db_query($query) { > if(!magic_quotes_gpc()){ > $qid = mysql_query(addslashes($query)); > } else { > $qid = mysql_query($query); > } > return $qid; > } > > But this adds too many slashes! Has anyone come to a better solution > regarding this? I believe you

Re: [PHP] Magic Quotes Issue

2004-12-07 Thread Richard Lynch
Shaun wrote: > function db_query($query) { > if(!magic_quotes_gpc()){ > $qid = mysql_query(addslashes($query)); > } else { > $qid = mysql_query($query); > } > return $qid; > } > > But this adds too many slashes! Has anyone come to a better solution > regarding this? Can you give us

Re: [PHP] Magic Quotes Issue

2004-12-07 Thread Gareth Williams
Try $string = mysql_real_escape_string($string); On 7 Dec 2004, at 14:12, Shaun wrote: Hi, I have been investigating the problem of apostrphes in a mysql insert / update. I use a db_query function for all my queries: function db_query($query) { $qid = mysql_query($query); return $qid; } It app

[PHP] Magic Quotes Issue

2004-12-07 Thread Shaun
Hi, I have been investigating the problem of apostrphes in a mysql insert / update. I use a db_query function for all my queries: function db_query($query) { $qid = mysql_query($query); return $qid; } It appears after some research that the best way around the problem is to check whether m