php-general | 2001072
Date: 07/18/01
- Next message: Martin Marconcini: "RE: [PHP] a good PHP editor"
- Previous message: Tyler Longren: "Re: [PHP] What PHP function to use to clean up PGP encoded text under Outlook Express?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Rasmus, solved this problem for me earlier today. Hope this helps
Rasmus,
Thank you very much. I ended up using the following statement, and it
works!!
> $results=mysql_query(stripslashes($sql_statement));
What I have now is a textarea box where I can input trial searches. This is
why I'm dealing with the whole sql statement. With time, I plan on passing
only the variables.
Thanks again.
Hugh
----- Original Message -----
From: Rasmus Lerdorf <rasmus <email protected>>
To: Hugh Danaher <hdanaher <email protected>>
Cc: <php-general <email protected>>
Sent: Wednesday, July 18, 2001 1:49 AM
Subject: Re: [PHP] help on getting rid of \'
> > I am working with php and mysql and have the need to write a query like:
> >
> > $sql_statement=mysql_query(" select * from table where column='string'
");
> >
> > What comes out is:
> >
> > select * from table where column=\'string\'
>
> Only if you pass that variable through a GET/POST/COOKIE operation and you
> have magic_quotes_gpc enabled in your php.ini file. Either turn
> magic_quotes off or call stripslashes() on your string before passing it
> to MySQL.
>
> But, are you sure you want to be passing entire query strings between
> pages? Normally you would only pass the actual query arguments. In your
> case probably the 'string' part.
>
> -Rasmus
>
- Next message: Martin Marconcini: "RE: [PHP] a good PHP editor"
- Previous message: Tyler Longren: "Re: [PHP] What PHP function to use to clean up PGP encoded text under Outlook Express?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

